mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Sync the two IDs in OrtMemoryInfo when calling ctor (#5663)
* Sync the two IDs in OrtMemoryInfo when calling ctor * Also fix the same problem for output
This commit is contained in:
parent
4936e10e22
commit
8856c2595b
1 changed files with 2 additions and 2 deletions
|
|
@ -1289,7 +1289,7 @@ void addObjectMethods(py::module& m, Environment& env) {
|
|||
int type_num = dtype->type_num;
|
||||
Py_DECREF(dtype);
|
||||
|
||||
OrtMemoryInfo info(GetDeviceName(device), OrtDeviceAllocator, device);
|
||||
OrtMemoryInfo info(GetDeviceName(device), OrtDeviceAllocator, device, device.Id());
|
||||
std::unique_ptr<Tensor> p_tensor =
|
||||
onnxruntime::make_unique<Tensor>(NumpyTypeToOnnxRuntimeType(type_num), shape, reinterpret_cast<void*>(data_ptr), info);
|
||||
|
||||
|
|
@ -1338,7 +1338,7 @@ void addObjectMethods(py::module& m, Environment& env) {
|
|||
int type_num = dtype->type_num;
|
||||
Py_DECREF(dtype);
|
||||
|
||||
OrtMemoryInfo info(GetDeviceName(device), OrtDeviceAllocator, device);
|
||||
OrtMemoryInfo info(GetDeviceName(device), OrtDeviceAllocator, device, device.Id());
|
||||
|
||||
std::unique_ptr<Tensor> p_tensor = onnxruntime::make_unique<Tensor>(NumpyTypeToOnnxRuntimeType(type_num), shape, reinterpret_cast<void*>(data_ptr), info);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue