You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/02/28 21:52:04 UTC
[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4970:
Added CopyFromBytes and CopyToBytes convenience methods to NDArray. Fixed
typos.
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_r385939469
##########
File path: include/tvm/runtime/ndarray.h
##########
@@ -306,6 +324,26 @@ inline void NDArray::CopyFrom(const NDArray& other) {
CopyFromTo(&(other.get_mutable()->dl_tensor), &(get_mutable()->dl_tensor));
}
+inline void NDArray::CopyFromBytes(const void* data, size_t nbytes) {
Review comment:
To avoid duplication, let us make it a non-line member function, and make uses of implementation in the C API here https://github.com/apache/incubator-tvm/blob/master/src/runtime/ndarray.cc#L289
After that, we can safely redirect the C API calls into these C++ APIs
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services