You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/03 20:06:29 UTC
[GitHub] zhreshold commented on a change in pull request #12625: [MXNET-979]
Add fix_beta support in BatchNorm
zhreshold commented on a change in pull request #12625: [MXNET-979] Add fix_beta support in BatchNorm
URL: https://github.com/apache/incubator-mxnet/pull/12625#discussion_r222449505
##########
File path: src/operator/nn/batch_norm.cc
##########
@@ -164,25 +164,65 @@ void BatchNormForwardImpl(mshadow::Stream<cpu> *,
// note that var is still invstd
if (!param_.fix_gamma) {
- if (IsBNWriting(req[batchnorm::kData])) {
- ForEachFast(inputData, outputData, channel,
- [thisWeight, thisBias, thisMean, thisInvstd](const DType *in_data,
- DType *out_data) {
- *out_data = static_cast<DType>(
- ((*in_data - thisMean) * thisInvstd) * thisWeight + thisBias);
- });
+ if (!param_.fix_beta) {
Review comment:
Do you really need 4 cases rather than collate 2 cases separately?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services