From 5c3b7ef81d624dbb4bd8e473d8a950ca93a450cf Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 16 Jul 2026 22:37:14 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20CastTypeInfoToTensorInfo=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20const=20=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/onnx/onnx.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/onnx/onnx.cpp b/pkg/onnx/onnx.cpp index dfc9420..a84e72d 100644 --- a/pkg/onnx/onnx.cpp +++ b/pkg/onnx/onnx.cpp @@ -245,7 +245,7 @@ extern "C" int onnx_get_input_shape( return -1; } - OrtTensorTypeAndShapeInfo* tensor_info = nullptr; + const OrtTensorTypeAndShapeInfo* tensor_info = nullptr; status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info); if (status) { last_error = g_ort->GetErrorMessage(status); @@ -263,7 +263,7 @@ extern "C" int onnx_get_input_shape( g_ort->GetDimensions(tensor_info, dims, dim_count); - g_ort->ReleaseTensorTypeAndShapeInfo(tensor_info); + g_ort->ReleaseTensorTypeAndShapeInfo((OrtTensorTypeAndShapeInfo*)tensor_info); g_ort->ReleaseTypeInfo(type_info); return (int)dim_count; @@ -289,7 +289,7 @@ extern "C" int onnx_get_output_shape( return -1; } - OrtTensorTypeAndShapeInfo* tensor_info = nullptr; + const OrtTensorTypeAndShapeInfo* tensor_info = nullptr; status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info); if (status) { last_error = g_ort->GetErrorMessage(status); @@ -307,7 +307,7 @@ extern "C" int onnx_get_output_shape( g_ort->GetDimensions(tensor_info, dims, dim_count); - g_ort->ReleaseTensorTypeAndShapeInfo(tensor_info); + g_ort->ReleaseTensorTypeAndShapeInfo((OrtTensorTypeAndShapeInfo*)tensor_info); g_ort->ReleaseTypeInfo(type_info); return (int)dim_count;