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/06/10 06:49:38 UTC

[GitHub] pengzhao-intel commented on a change in pull request #11024: [MXNET-394] concat of CSR NDArrays on first dimension

pengzhao-intel 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_r194247442
 
 

 ##########
 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:
   Yes, MKL-DNN `concat` only supports the dim >0 now. Will take a look at the current flow.

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