larroy commented on a change in pull request #9862: Fix a race condition in 
converting data layouts in MKLDNN.
URL: https://github.com/apache/incubator-mxnet/pull/9862#discussion_r170271059
 
 

 ##########
 File path: src/ndarray/ndarray.cc
 ##########
 @@ -1017,6 +1017,7 @@ inline void CopyFromToDnsImpl(const NDArray& from, const 
NDArray& to, RunContext
     // with Copy().
     NDArray tmp_from = from;
     if (tmp_from.IsMKLDNNData()) {
+      // TODO(zhengda) tmp_from should be cached.
 
 Review comment:
   @cjolivier01  sure it's legal to change data through a pointer from a const 
method, but having unexpected side effects from a class contract which 
indicates that a method is const leads to problems, is not particularly 
considered a good practice when programming: 
https://stackoverflow.com/questions/763835/are-side-effects-a-good-thing  
having experience with functional programming languages helps appreciate 
controlled side effects.

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