tqchen commented on a change in pull request #12047: [MXNET-779]Add DLPack
Transformation API
URL: https://github.com/apache/incubator-mxnet/pull/12047#discussion_r207953809
##########
File path: python/mxnet/cython/ndarray.pyx
##########
@@ -52,12 +53,15 @@ cdef class NDArrayBase:
def __get__(self):
return bool(self.cwritable)
- def __init__(self, handle, writable=True):
+ def __init__(self, handle, writable=True, dlpack_handle=None):
self._set_handle(handle)
self.cwritable = writable
+ self.cdlpack_handle = dlpack_handle
def __dealloc__(self):
CALL(MXNDArrayFree(self.chandle))
+ if self.cdlpack_handle:
+ CALL(MXNDArrayCallDLPackDeleter(self.cdlpack_handle))
Review comment:
do not put dlpack_handle inside the object
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services