From cd2f98223442297fb51666ce748a79ec4bf4c1f4 Mon Sep 17 00:00:00 2001 From: Yongyue Sun Date: Tue, 5 Mar 2024 19:57:12 +0800 Subject: [PATCH] Improve `DataTypeError` message with parametrized dimension --- wonnx/src/utils.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wonnx/src/utils.rs b/wonnx/src/utils.rs index 80bfc144..5d136d59 100644 --- a/wonnx/src/utils.rs +++ b/wonnx/src/utils.rs @@ -487,10 +487,11 @@ impl ValueInfoProto { .get_shape() .get_dim() .iter() - .map(|x| { + .enumerate() + .map(|(idx, x)| { if x.has_dim_param() { return Err(DataTypeError::ParametrizedDimensionUnsupported( - x.get_dim_param().to_string(), + self.get_name().to_string() + "#" + &idx.to_string(), )); } Ok(x.get_dim_value())