haojin2 commented on a change in pull request #11631: Fix batchnorm problem 
with sparse matrices when fix_gamma=True
URL: https://github.com/apache/incubator-mxnet/pull/11631#discussion_r201770974
 
 

 ##########
 File path: src/operator/nn/batch_norm.cc
 ##########
 @@ -452,19 +453,56 @@ static inline bool BatchNormStorageType(const 
nnvm::NodeAttrs &attrs,
                                         std::vector<int> *out_attrs) {
   CHECK_EQ(in_attrs->size(), 5);
   CHECK_EQ(out_attrs->size(), 3);
+  const BatchNormParam &param = nnvm::get<BatchNormParam>(attrs.parsed);
+
+  if ((common::ContainsStorageType(*in_attrs, kRowSparseStorage) ||
+       common::ContainsStorageType(*in_attrs, kCSRStorage)) &&
+      param.fix_gamma) {
+    LOG(FATAL) << "fix_gamma=True is not supported for sparse ndarrays";
 
 Review comment:
   Done

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to