You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEA]: Support importing __c_dlpack_exchange_api__ objects as StridedMemoryView #1439
Add support for importing objects that implement the __c_dlpack_exchange_api__ protocol as StridedMemoryView objects.
Motivation
The __c_dlpack_exchange_api__ protocol provides a C-level interface for efficient zero-copy data exchange. Currently, StridedMemoryView supports construction from Python-level protocols (__dlpack__, __cuda_array_interface__, buffer protocol), but does not support the C-level exchange API.
Supporting this protocol would enable:
More efficient data sharing with libraries that expose the C-level API
Reduced overhead by avoiding Python-level protocol dispatch
Better integration with Cython-based libraries that use the C exchange API
Requested Features
Add a class method or constructor path in StridedMemoryView that can consume objects implementing __c_dlpack_exchange_api__
Properly handle the DLManagedTensor lifecycle (deleter callback)
TBH I am not convinced this has any real benefit, mainly because this is a very new and somewhat tailored solution that not many libraries have adopted (ex: we do not offer this in CuPy); for PyTorch, starting v1.0.0 torch.Tensor goes through the tensor bridge (#1894) so this is moot anyway.
In any case, the work was done in #1630 and was shipped in v0.7.0. Closing.
Activity
leofang commentedon May 8, 2026
TBH I am not convinced this has any real benefit, mainly because this is a very new and somewhat tailored solution that not many libraries have adopted (ex: we do not offer this in CuPy); for PyTorch, starting v1.0.0
torch.Tensorgoes through the tensor bridge (#1894) so this is moot anyway.In any case, the work was done in #1630 and was shipped in v0.7.0. Closing.