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/12 16:56:28 UTC

[GitHub] zheng-da commented on a change in pull request #11129: [MXNET-497]Test kAddTo request for mkldnn operators

zheng-da commented on a change in pull request #11129: [MXNET-497]Test kAddTo request for mkldnn operators
URL: https://github.com/apache/incubator-mxnet/pull/11129#discussion_r194811728
 
 

 ##########
 File path: src/operator/nn/mkldnn/mkldnn_base.cc
 ##########
 @@ -304,18 +383,26 @@ void FallBackCompute(FCompute fn, const nnvm::NodeAttrs &attrs,
   MKLDNNStream::Get()->Submit();
 
   std::vector<TBlob> out_blobs(outputs.size());
+  std::vector<NDArray> temp_src, temp_dst;
   for (size_t i = 0; i < out_blobs.size(); i++) {
     NDArray output = outputs[i];
     // ensure output does not use mkldnn mem.
     // for inplace, we already converted & copied input above.
-    if ((req[i] == kWriteTo) || (req[i] == kWriteInplace))
+    if ((req[i] == kWriteTo) || (req[i] == kWriteInplace)) {
       const_cast<NDArray &>(output).InvalidateMKLDNNData();
-    else if (req[i] == kAddTo)
-      output = outputs[i].Reorder2Default();
+    } else if (req[0] == kAddTo && output.IsMKLDNNData()) {
 
 Review comment:
   I wonder if it's necessary that in the case of fallback, the output is still an MKLDNN array?
   I know the unit test can trigger the problem.

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