Name |
Last commit
|
Last update |
---|---|---|
.. | ||
_ctypes | ||
_cy2 | ||
_cy3 | ||
_cython | ||
__init__.py | ||
base.py | ||
function.py | ||
libinfo.py | ||
ndarray.py | ||
node.py | ||
node_generic.py | ||
object.py | ||
runtime_ctypes.py |
* [REFACTOR][RUNTIME] Move NDArray to Object System. Previously NDArray has its own object reference counting mechanism. This PR migrates NDArray to the unified object protocol. The calling convention of NDArray remained intact. That means NDArray still has its own type_code and its handle is still DLTensor compatible. In order to do so, this PR added a few minimum runtime type detection in TVMArgValue and RetValue only when the corresponding type is a base type(ObjectRef) that could also refer to NDArray. This means that even if we return a base reference object ObjectRef which refers to the NDArray. The type_code will still be translated correctly as kNDArrayContainer. If we assign a non-base type(say Expr) that we know is not compatible with NDArray during compile time, no runtime type detection will be performed. This PR also adopts the object protocol for NDArray sub-classing and removed the legacy NDArray subclass protocol. Examples in apps/extension are now updated to reflect that. Making NDArray as an Object brings all the benefits of the object system. For example, we can now use the Array container to store NDArrays. * Address review comments
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
_ctypes | Loading commit data... | |
_cy2 | Loading commit data... | |
_cy3 | Loading commit data... | |
_cython | Loading commit data... | |
__init__.py | Loading commit data... | |
base.py | Loading commit data... | |
function.py | Loading commit data... | |
libinfo.py | Loading commit data... | |
ndarray.py | Loading commit data... | |
node.py | Loading commit data... | |
node_generic.py | Loading commit data... | |
object.py | Loading commit data... | |
runtime_ctypes.py | Loading commit data... |