ANSHUMAN87 commented on a change in pull request #6586:
URL: https://github.com/apache/incubator-tvm/pull/6586#discussion_r496975400
##########
File path: src/runtime/ndarray.cc
##########
@@ -70,9 +70,12 @@ void ArrayCopyFromBytes(DLTensor* handle, const void* data,
size_t nbytes) {
cpu_ctx.device_id = 0;
size_t arr_size = GetDataSize(*handle);
CHECK_EQ(arr_size, nbytes) << "ArrayCopyFromBytes: size mismatch";
+ CHECK(IsContiguous(*handle)) << "ArrayCopyFromBytes only support contiguous
array for now";
Review comment:
I think we can add this check earliest!
##########
File path: src/runtime/ndarray.cc
##########
@@ -81,9 +84,12 @@ void ArrayCopyToBytes(const DLTensor* handle, void* data,
size_t nbytes) {
cpu_ctx.device_id = 0;
size_t arr_size = GetDataSize(*handle);
CHECK_EQ(arr_size, nbytes) << "ArrayCopyToBytes: size mismatch";
+ CHECK(IsContiguous(*handle)) << "ArrayCopyToBytes only support contiguous
array for now";
Review comment:
same as above!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]