diff --git a/onnxruntime/test/optimizer/gpu_op_prepack_test.cc b/onnxruntime/test/optimizer/gpu_op_prepack_test.cc index 7c4c03e18c7a2..ccde5d199ef0b 100644 --- a/onnxruntime/test/optimizer/gpu_op_prepack_test.cc +++ b/onnxruntime/test/optimizer/gpu_op_prepack_test.cc @@ -140,7 +140,8 @@ inline Status GetOrtValue(const NodeArg* arg, const Graph& graph, OrtValue& ort_ ORT_RETURN_IF_NOT(graph.GetInitializedTensor(arg->Name(), tensor_proto), "Missing initializer for ", arg->Name()); - const auto path_str = graph.ModelPath().ToPathString(); + const onnxruntime::Path& model_path = graph.ModelPath(); + const auto path_str = model_path.ToPathString(); return utils::TensorProtoToOrtValue( Env::Default(), path_str.c_str(), *tensor_proto,