You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/01/03 20:15:52 UTC

[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17204: Enhancements for MXTensor for custom operators

samskalicky commented on a change in pull request #17204: Enhancements for MXTensor for custom operators
URL: https://github.com/apache/incubator-mxnet/pull/17204#discussion_r362946497
 
 

 ##########
 File path: include/mxnet/lib_api.h
 ##########
 @@ -209,10 +210,15 @@ enum MXReturnValue {
  * \brief Tensor data structure used by custom operator
  */
 struct MXTensor {
-  MXTensor() : data_ptr(NULL) {}
+MXTensor() : data_ptr(NULL), dtype(kUNSET), version(0) {}
 
-  MXTensor(void *data_ptr, const std::vector<int64_t> &shape, MXDType dtype)
-  : data_ptr(data_ptr), shape(shape), dtype(dtype) {}
+  MXTensor(void *data_ptr, const std::vector<int64_t> &shape, MXDType dtype,
+           size_t ID)
+  : data_ptr(data_ptr), shape(shape), dtype(dtype), version(ID) {}
+
+  void update(void *dptr, MXDType type, size_t ver) {
 
 Review comment:
   per our discussion, lets move the the for loop to copy shape and call to setDLTensor inside this function. Change name to "setTensor"

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