diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 8ae57efd31..6bc48dafba 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -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 p_tensor = onnxruntime::make_unique(NumpyTypeToOnnxRuntimeType(type_num), shape, reinterpret_cast(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 p_tensor = onnxruntime::make_unique(NumpyTypeToOnnxRuntimeType(type_num), shape, reinterpret_cast(data_ptr), info);