wkcn commented on issue #11927: Substitute of torch.Tensor.data_ptr() 
URL: 
https://github.com/apache/incubator-mxnet/issues/11927#issuecomment-409067222
 
 
   Using `MXNDArrayGetData` to get the first element of the NDArray.
   
   Notice: You should call `wait_to_read` before reading a NDArray and call 
`wait_to_write` before writing a NDArray.
   
   There is no  `wait_to_write` in NDArray, so
   
   `mx.nd.NDArray.wait_to_write = lambda self : 
_LIB.MXNDArrayWaitToWrite(self.handle)`
   
   Example:
   
   https://github.com/wkcn/MobulaOP/blob/master/mobula_op/glue/mx.py#L28

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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