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

 ##########
 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:
   if the output is not MKLDNN then we do not need to enter this block because 
we will able to call the FCompute function on the output directly.

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