From 4166b832df0a4bde755b5ce93f169d37c39cdb16 Mon Sep 17 00:00:00 2001 From: Chi Lo Date: Mon, 25 Mar 2024 09:14:12 -0700 Subject: [PATCH] Fix compile warning --- .../tensorrt/tensorrt_execution_provider.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc index 247eecdc06dcf..b3cad3af9cb7c 100644 --- a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc +++ b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc @@ -587,28 +587,28 @@ Status ApplyProfileShapesFromInputTensorValue(std::vector(shape_size); - auto status = GetShapeOfShapeTensor(input_tensor, input.get(), shape_size, stream); + auto buffer = std::make_unique(shape_size); + auto status = GetShapeOfShapeTensor(input_tensor, buffer.get(), shape_size, stream); if (status != Status::OK()) { return ORT_MAKE_STATUS(ONNXRUNTIME, EP_FAIL, status.ErrorMessage()); } shape_tensor_values[input_name].resize(shape_size); for (int j = 0; j < shape_size; ++j) { - shape_tensor_values[input_name][j] = input[j]; - values[j] = input[j]; + shape_tensor_values[input_name][j] = buffer[j]; + values[j] = buffer[j]; } break; } case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64: { - auto input = std::make_unique(shape_size); - auto status = GetShapeOfShapeTensor(input_tensor, input.get(), shape_size, stream); + auto buffer = std::make_unique(shape_size); + auto status = GetShapeOfShapeTensor(input_tensor, buffer.get(), shape_size, stream); if (status != Status::OK()) { return ORT_MAKE_STATUS(ONNXRUNTIME, EP_FAIL, status.ErrorMessage()); } shape_tensor_values_int64[input_name].resize(shape_size); for (int j = 0; j < shape_size; ++j) { - shape_tensor_values_int64[input_name][j] = input[j]; - values[j] = static_cast(input[j]); + shape_tensor_values_int64[input_name][j] = buffer[j]; + values[j] = static_cast(buffer[j]); } break; }