tqchen commented on a change in pull request #4970: Added CopyFromBytes and
CopyToBytes convenience methods to NDArray. Fixed typos.
URL: https://github.com/apache/incubator-tvm/pull/4970#discussion_r385990080
##########
File path: src/runtime/ndarray.cc
##########
@@ -185,6 +185,18 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
return NDArray(GetObjectPtr<Object>(data));
}
+void NDArray::CopyToBytes(void* data, size_t nbytes) const {
+ CHECK(data != nullptr);
+ CHECK(data_ != nullptr);
+ CHECK_EQ(TVMArrayCopyToBytes(&get_mutable()->dl_tensor, data, nbytes), 0);
Review comment:
no worries, we always need to iterate to make better versions. Thanks for
being patient in improving things
----------------------------------------------------------------
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]
With regards,
Apache Git Services