Skip to content

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

Open
@justinchuby

Description

@justinchuby

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiissues related to all other APIs: C, C++, Python, etc.feature requestrequest for unsupported feature or enhancementpythonPull requests that update Python code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions