cjolivier01 commented on a change in pull request #10090: [MXNET-86] Revert to 
pre-profile-changes copy code
URL: https://github.com/apache/incubator-mxnet/pull/10090#discussion_r174295660
 
 

 ##########
 File path: src/ndarray/ndarray_function.cc
 ##########
 @@ -26,35 +26,24 @@
 #include "./ndarray_function.h"
 #include "./ndarray_function-inl.h"
 #include "../common/utils.h"
-#include "../operator/mxnet_op.h"
 
 namespace mxnet {
 namespace ndarray {
 template<>
 void Copy<cpu, cpu>(const TBlob &from, TBlob *to,
                     Context from_ctx, Context to_ctx,
                     RunContext ctx) {
-  using namespace mxnet::op;
   MSHADOW_TYPE_SWITCH(to->type_flag_, DType, {
     if (to->type_flag_ == from.type_flag_) {
-      TBlob dest = to->FlatTo1D<cpu, DType>();
-      TBlob src = from.FlatTo1D<cpu, DType>();
-      const size_t size = src.Size();
-      if (dest.CheckContiguous() && src.CheckContiguous() && size >= 20000 /* 
non-trivial size */) {
-        CHECK_EQ(dest.shape_, src.shape_)
-          << "Copy:shape mismatch:" << dest.shape_ << " vs " << src.shape_;
-          mxnet_op::Kernel<mxnet_op::op_with_req<mshadow_op::identity, 
kWriteTo>, cpu>::Launch(
-            ctx.get_stream<cpu>(), src.Size(), dest.dptr<DType>(), 
src.dptr<DType>());
 
 Review comment:
   I don't see why not, but I am just going to revert now because the change 
wasn't worth the trouble it caused.

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