Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conforming array_api_standards via __dlpack__ and __dlpack_device__ methods #56891

Open
abdulasiraj opened this issue Sep 1, 2023 · 2 comments
Assignees

Comments

@abdulasiraj
Copy link

abdulasiraj commented Sep 1, 2023

需求描述 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

@zhangting2020
Copy link
Contributor

Thank you for your suggestion. May I know if paddle.utils.dlpack.from_dlpack(dlpack) and paddle.utils.dlpack.from_dlpack(dlpack) can meet this requirement?

@zhangting2020 zhangting2020 self-assigned this Sep 4, 2023
@luotao1 luotao1 added the API label Sep 5, 2023
@abdulasiraj
Copy link
Author

abdulasiraj commented Sep 6, 2023

Hi @zhangting2020,
Thanks for your response. from_dlpack and to_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants