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_r195193780
 
 

 ##########
 File path: src/common/exec_utils.h
 ##########
 @@ -98,10 +98,13 @@ inline bool SetupDefaultBlobsOut(const 
std::vector<NDArray>& src,
     is_default = nd.IsDefaultData();
 #endif
     if (!is_default) {
-      NDArray temp = bufs != nullptr ? bufs->at(i) : NDArray(nd.shape(), 
nd.ctx(),
-                                                             true, nd.dtype());
 #if MXNET_USE_MKLDNN == 1
+        NDArray temp = bufs != nullptr ? bufs->at(i) : nd.IsMKLDNNData() ?
+            nd.Reorder2Default() : NDArray(nd.shape(), nd.ctx(), true, 
nd.dtype());
 
 Review comment:
   is_default could be false because it is a sparse ndarray. in which case we 
cannot call reorder2default and will just make a copy like we previously did. 
this does mean that kAddTo won't work as we are not preserving the data to tmp.

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