tqchen commented on a change in pull request #9880: TVM bridge support to JIT NDArray Function by TVM URL: https://github.com/apache/incubator-mxnet/pull/9880#discussion_r170464450
########## File path: python/mxnet/ndarray/ndarray.py ########## @@ -174,8 +174,14 @@ class NDArray(NDArrayBase): __slots__ = [] # make numpy functions return NDArray instead of numpy object array __array_priority__ = 1000.0 + # used by tvm bridge + _tvm_tcode = 19 # pylint: disable= no-member, undefined-variable + @property + def _tvm_handle(self): + return self.handle.value Review comment: This is a handle exposed for PackedFunc convention interface of TVM, to allow arbitrary positional arguments calls without adding new C API. Specifically, the wrapped function is a TVM PackedFunc that will recognize NDArray as an extension object, and pass the address of NDArray handles correctly to the arguments. It is later received in here https://github.com/apache/incubator-mxnet/pull/9880/files#diff-3aa2a3c799e125e086769bc1d5f6490aR74 ---------------------------------------------------------------- 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