onnxruntime
b3e1a9e6 - Python API for HOST_ACCESSIBLE OrtValue allocation (#28038)

Commit
44 days ago
Python API for HOST_ACCESSIBLE OrtValue allocation (#28038) ### Description Adds memory_info= parameter to OrtValue.ortvalue_from_shape_and_type(), backed by two new C-level factory methods that look up the registered shared allocator via the full OrtMemoryInfo (including mem_type). This is required because the current shared allocator query doesn't include the memory type making HOST_ACCESSIBLE invisible to python. UsesCpuMemory() is used in GetPyObjFromTensor so that tensors in HOST_ACCESSIBLE memory are returned as zero-copy numpy views. ### Motivation and Context Enable zero copy interop between numpy and ortvalue. This is a follow up for https://github.com/microsoft/onnxruntime/pull/28037
Author
Parents
Loading