eric-haibin-lin commented on a change in pull request #11024: [MXNET-394] 
concat of CSR NDArrays on first dimension
URL: https://github.com/apache/incubator-mxnet/pull/11024#discussion_r194190518
 
 

 ##########
 File path: src/operator/nn/concat.cc
 ##########
 @@ -112,18 +112,30 @@ inline static bool ConcatForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
                                                  std::vector<int> *out_attrs) {
   CHECK(!in_attrs->empty());
   CHECK_EQ(out_attrs->size(), 1U);
-  DispatchMode wanted_mode;
-#if MXNET_USE_MKLDNN == 1
+  auto& out_stype = out_attrs->at(0);
+  bool dispatched = false;
   const ConcatParam& param = nnvm::get<ConcatParam>(attrs.parsed);
-  if (dev_mask == mshadow::cpu::kDevMask
+  if (!dispatched && common::ContainsOnlyStorage(*in_attrs, kCSRStorage)
+      && param.dim == 0) {
+    dispatched = storage_type_assign(&out_stype, kCSRStorage,
+                                     dispatch_mode, DispatchMode::kFComputeEx);
+  }
+#if MXNET_USE_MKLDNN == 1
+  if (!dispatched && dev_mask == mshadow::cpu::kDevMask
       && common::ContainsOnlyStorage(*in_attrs, kDefaultStorage)
-      && param.dim > 0)
-    wanted_mode = DispatchMode::kFComputeEx;
-  else
+      && param.dim > 0) {
 
 Review comment:
   @zheng-da @pengzhao-intel is mkldnn concat only limited to dim > 0? Should 
be trivial to support negative dims I think

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to