TaoLv commented on a change in pull request #12926: parallelize
NDArray::Copy<cpu, cpu> when data size is large
URL: https://github.com/apache/incubator-mxnet/pull/12926#discussion_r235732685
##########
File path: src/ndarray/ndarray_function.cc
##########
@@ -38,13 +38,14 @@ void Copy<cpu, cpu>(const TBlob &from, TBlob *to,
RunContext ctx) {
MSHADOW_TYPE_SWITCH(to->type_flag_, DType, {
if (to->type_flag_ == from.type_flag_) {
- mshadow::Copy(to->FlatTo1D<cpu, DType>(),
- from.FlatTo1D<cpu, DType>());
+ const index_t size = from.Size();
+ CHECK_EQ(size, to->Size());
Review comment:
Please add descriptive error message here.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services