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/12/13 18:29:43 UTC

[GitHub] mseth10 commented on a change in pull request #13084: Test/mkldnn batch norm op

mseth10 commented on a change in pull request #13084: Test/mkldnn batch norm op
URL: https://github.com/apache/incubator-mxnet/pull/13084#discussion_r241512706
 
 

 ##########
 File path: src/operator/nn/batch_norm.cc
 ##########
 @@ -380,12 +380,20 @@ static bool BatchNormType(const nnvm::NodeAttrs& attrs,
 }
 
 #if MXNET_USE_MKLDNN == 1
-static inline bool SupportMKLDNNBN(const NDArray &input, const BatchNormParam &param) {
-  TShape shape = input.shape();
-  return SupportMKLDNN(input) && shape.ndim() == 4
+static inline bool SupportMKLDNNBN(const std::vector<NDArray> &inputs,
+    const BatchNormParam &param) {
+  TShape shape = inputs[0].shape();
+  bool params_valid = shape.ndim() == 4
       && param.axis == mxnet::op::batchnorm::DEFAULT_AXIS
       && shape[param.axis] % 8 == 0
       && !mxnet::op::batchnorm::disable_mkl;
+  bool inputs_valid = SupportMKLDNN(inputs[0]);
+  for (size_t i = 1; i < inputs.size(); i++) {
+    if (inputs[i].IsMKLDNNData()) {
 
 Review comment:
   Once inputs_valid is set to false, we need not check remaining inputs, we can add a break here.
   `if (!inputs_valid) break;`

----------------------------------------------------------------
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