fix: CastTypeInfoToTensorInfo 使用 const 指针
This commit is contained in:
+4
-4
@@ -245,7 +245,7 @@ extern "C" int onnx_get_input_shape(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
OrtTensorTypeAndShapeInfo* tensor_info = nullptr;
|
const OrtTensorTypeAndShapeInfo* tensor_info = nullptr;
|
||||||
status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info);
|
status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info);
|
||||||
if (status) {
|
if (status) {
|
||||||
last_error = g_ort->GetErrorMessage(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->GetDimensions(tensor_info, dims, dim_count);
|
||||||
|
|
||||||
g_ort->ReleaseTensorTypeAndShapeInfo(tensor_info);
|
g_ort->ReleaseTensorTypeAndShapeInfo((OrtTensorTypeAndShapeInfo*)tensor_info);
|
||||||
g_ort->ReleaseTypeInfo(type_info);
|
g_ort->ReleaseTypeInfo(type_info);
|
||||||
|
|
||||||
return (int)dim_count;
|
return (int)dim_count;
|
||||||
@@ -289,7 +289,7 @@ extern "C" int onnx_get_output_shape(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
OrtTensorTypeAndShapeInfo* tensor_info = nullptr;
|
const OrtTensorTypeAndShapeInfo* tensor_info = nullptr;
|
||||||
status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info);
|
status = g_ort->CastTypeInfoToTensorInfo(type_info, &tensor_info);
|
||||||
if (status) {
|
if (status) {
|
||||||
last_error = g_ort->GetErrorMessage(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->GetDimensions(tensor_info, dims, dim_count);
|
||||||
|
|
||||||
g_ort->ReleaseTensorTypeAndShapeInfo(tensor_info);
|
g_ort->ReleaseTensorTypeAndShapeInfo((OrtTensorTypeAndShapeInfo*)tensor_info);
|
||||||
g_ort->ReleaseTypeInfo(type_info);
|
g_ort->ReleaseTypeInfo(type_info);
|
||||||
|
|
||||||
return (int)dim_count;
|
return (int)dim_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user