需求描述 Feature Description
Right now, paddle only produce and consume PyCapsules. However, dealing with raw capsules is outdated. Also, numpy doesn't supports PyCapsules. It's better if paddle tensors also support __dlpack__
and __dlpack_devce__
dunders.
替代实现 Alternatives
No response
2条答案
按热度按时间yduiuuwa1#
Thank you for your suggestion. May I know if
paddle.utils.dlpack.from_dlpack(dlpack)
andpaddle.utils.dlpack.from_dlpack(dlpack)
can meet this requirement?z5btuh9x2#
Hi @zhangting2020,
Thanks for your response.
from_dlpack
andto_dlpack
are legacy functions now. All frameworks are now implementing__dlpack__
and__dlpack_device__
dunders for their Tensors. It can be seen here:https://dmlc.github.io/dlpack/latest/python_spec.html
https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.dlpack.html
Also numpy doesn't support PyCapsules
numpy/numpy#24575