YuchenJin opened a new pull request #7993:
URL: https://github.com/apache/tvm/pull/7993


   Adopt the new [Python array API standard with 
DLPack](https://data-apis.org/array-api/latest/design_topics/data_interchange.html#syntax-for-data-interchange-with-dlpack):
   
   - Add `__dlpack__(self, stream=None)` and `__dlpack_device__(self)` methods 
on `tvm.nd.NDArray`. Note that tvm operates on the legacy default stream by 
default, so no explicit synchronization is needed.
   - `tvm.nd.from_dlpack` can take a tensor-like object with `__dlpack__` 
method, or a DLPack capsule.
   
   
   More contexts:
   - API design discussion: https://github.com/dmlc/dlpack/issues/57
   - PyTorch support: https://github.com/pytorch/pytorch/issues/55090, 
https://github.com/pytorch/pytorch/pull/57110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to