Skip to content

[Feature Request] Make OrtValue compatible with numpy __array__ and dlpack protocols #24071

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

Open
justinchuby opened this issue Mar 17, 2025 · 1 comment
Labels
api issues related to all other APIs: C, C++, Python, etc. feature request request for unsupported feature or enhancement python Pull requests that update Python code

Comments

@justinchuby
Copy link
Contributor

justinchuby commented Mar 17, 2025

Describe the feature request

For a pythonic type conversion and data sharing user experience.

Describe scenario use case

DLPack has been enabled in #23110.

  1. We should expose it in the onnxruntime.OrtValue class and allow from_dlpack to call __dlpack__ on source tensors automatically.
  2. We should remove the is_bool argument by upgrading dlpack version.

Similarly, we should also implement https://numpy.org/devdocs/user/basics.interoperability.html to modernize the class.

cc @snnn @xadupre @baijumeswani

@justinchuby justinchuby added the feature request request for unsupported feature or enhancement label Mar 17, 2025
@xadupre
Copy link
Member

xadupre commented Mar 19, 2025

I think my answer from #24095 would be useful here as well.

@xadupre xadupre added api issues related to all other APIs: C, C++, Python, etc. python Pull requests that update Python code labels Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api issues related to all other APIs: C, C++, Python, etc. feature request request for unsupported feature or enhancement python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants