jmorrill 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_r385980113
########## 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: Not a problem.. Sorry it has taken so many revisions :). At least they are easy changes. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services