wkcn commented on a change in pull request #12047: [MXNET-779]Add DLPack 
Transformation API
URL: https://github.com/apache/incubator-mxnet/pull/12047#discussion_r209442740
 
 

 ##########
 File path: python/mxnet/_ctypes/ndarray.py
 ##########
 @@ -31,21 +31,24 @@
 
 class NDArrayBase(object):
     """Base data structure for ndarray"""
-    __slots__ = ["handle", "writable"]
+    __slots__ = ["handle", "writable", "dlpack"]
     # pylint: disable= no-member
 
-    def __init__(self, handle, writable=True):
+    def __init__(self, handle, writable=True, dlpack=None):
 
 Review comment:
   I made a copy of NDArray as the member of NDArrayDLManager, and the copy 
increase the refcount.
   I'm confused how to modify the PR.
   After creating a new NDArray(Python) from DLPack, then delete the old 
NDArray(Python) and PyCapsule(DLPack).
   
   Which object will call the deleter function?
   
   In my case, when `a` gets deleted, how does `b` hold the NDArrayDLManager? 
It seems that `b` only get the pure data pointer from 
`DLManagedTensor::dl_tensor::data`, the type of the pointer is not shared 
pointer.
   And how does `b` store the pointer to `NDArrayDLManager` in MXNet NDArray?

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