From 62e086706281503531e4377c3a8e9012ee9e6a83 Mon Sep 17 00:00:00 2001 From: Vinayak Dev Date: Mon, 23 Sep 2024 13:48:56 +0530 Subject: [PATCH] Address comments. Improve diagnostics in GetImmediateShapeTensor() --- .../iree/compiler/torch-mlir-import-onnx/OnnxImporter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/iree/compiler/torch-mlir-import-onnx/OnnxImporter.cpp b/onnxruntime/core/providers/iree/compiler/torch-mlir-import-onnx/OnnxImporter.cpp index b28054b4cf3b4..b81e90c171cae 100644 --- a/onnxruntime/core/providers/iree/compiler/torch-mlir-import-onnx/OnnxImporter.cpp +++ b/onnxruntime/core/providers/iree/compiler/torch-mlir-import-onnx/OnnxImporter.cpp @@ -1015,8 +1015,11 @@ Status NodeImporter::GetImmediateShapeTensor(const std::string &name, const onnx::TensorProto *tensor = graph_info_.graph_viewer().GetConstantInitializer(name, false); if (!tensor) { - return SetError( - "Could not find immediate shape tensor in graph initializers"); + std::string msg = "Could not find the immediate shape tensor "; + msg.append(name); + msg.append(" in constant graph initializers. It was possibly produced " + "dynamically."); + return SetError(msg); } const onnx::TensorProto &tp = *tensor;