zheng-da 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_r170165614
 
 

 ##########
 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:
   const can have a lot of definitions. I don't think it's a bad design. here 
const means the values of the array are always the same, even though its layout 
may be changed. if we strictly follow the rule that const function doesn't 
modify data in an array, the code would become unmanagable. In fact, the data 
in a const array in MXNet is modified all the time. 

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