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_r385959768
 
 

 ##########
 File path: include/tvm/runtime/ndarray.h
 ##########
 @@ -68,19 +68,37 @@ class NDArray : public ObjectRef {
   /*!
    * \brief Copy data content from another array.
    * \param other The source array to be copied from.
-   * \note The copy may happen asynchrously if it involves a GPU context.
+   * \note The copy may happen asynchronously if it involves a GPU context.
    *       TVMSynchronize is necessary.
    */
   inline void CopyFrom(const DLTensor* other);
   inline void CopyFrom(const NDArray& other);
+  /*!
+ * \brief Copy data content from a byte buffer.
+ * \param data The source bytes to be copied from.
+ * \param nbytes The size of the buffer in bytes
+ *        Must be equal to the size of the NDArray.
+ * \note The copy may happen asynchronously if it involves a GPU context.
+ *       TVMSynchronize is necessary.
+ */
+  inline void CopyFromBytes(const void* data, size_t nbytes);
 
 Review comment:
   Changed!

----------------------------------------------------------------
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

Reply via email to