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

 ##########
 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:
   do we really need this function? it doesn't have any checks, only copy 
pointers. I think we can copy them line by line in lib_api.h and keep MXTensor 
as simple as possible

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

Reply via email to