Skip to content

Commit acd44bf

Browse files
authored
Fix creating a view of an Ort::Value tensor. (#2939)
1 parent 1f5f963 commit acd44bf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sherpa-onnx/csrc/onnx-utils.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ Ort::Value View(Ort::Value *v) {
189189
auto type_and_shape = v->GetTensorTypeAndShapeInfo();
190190
std::vector<int64_t> shape = type_and_shape.GetShape();
191191

192-
auto memory_info =
193-
Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeDefault);
192+
auto memory_info = v->GetTensorMemoryInfo();
193+
194194
switch (type_and_shape.GetElementType()) {
195195
case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
196196
return Ort::Value::CreateTensor(

0 commit comments

Comments
 (0)