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 2020/07/23 14:42:25 UTC

[GitHub] [incubator-mxnet] anko-intel commented on a change in pull request #18777: [v1.7.x] ElementWiseSum fix for oneDNN

anko-intel commented on a change in pull request #18777:
URL: https://github.com/apache/incubator-mxnet/pull/18777#discussion_r459502487



##########
File path: src/operator/tensor/elemwise_sum.cc
##########
@@ -118,11 +118,26 @@ void ElementWiseSumComputeExCPU(const nnvm::NodeAttrs& attrs,
        inputs[1].storage_type() == kCSRStorage && inputs[2].storage_type() == kDefaultStorage) ||
       (inputs.size() > 4U && common::ContainsStorageType(inputs, kDefaultStorage) &&
        outputs[0].storage_type() == kDefaultStorage)) {
+    
     mshadow::Stream<cpu>* s = ctx.get_stream<cpu>();
     Resource rsc = ResourceManager::Get()->Request(ctx.run_ctx.get_ctx(),
         ResourceRequest(ResourceRequest::kTempSpace));
     NDArray out_nd = outputs[0];
+#if MXNET_USE_MKLDNN == 1
+      std::vector<NDArray> in_data;
+      for (const NDArray& in : inputs) {
+        // if ndarray is in default storage and MKLDNN is available,
+        // need to make sure cpu layout data is used, instead of MKL layout
+        if (in.storage_type() == kDefaultStorage) {

Review comment:
        && in.IsMKLDNNData()




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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