From 8e1b30e133b1a7e7d99a1b4fd070f8c888e3283a Mon Sep 17 00:00:00 2001 From: Gheorghe-Teodor Bercea Date: Wed, 4 Mar 2020 14:34:08 -0500 Subject: [PATCH] Check channel dimension mismatch only for known dimensions (#2) Co-authored-by: Gheorghe-Teodor Bercea --- src/dialect/onnx/onnx_ops.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dialect/onnx/onnx_ops.cpp b/src/dialect/onnx/onnx_ops.cpp index 5474856..78ba92b 100644 --- a/src/dialect/onnx/onnx_ops.cpp +++ b/src/dialect/onnx/onnx_ops.cpp @@ -781,7 +781,8 @@ void ONNXConvNoBiasOp::inferShapes() { int64_t group = ONNXConvNoBiasOp::group().getSExtValue(); //.getLimitedValue(); // Check that the X.shape[1] == (W.shape[1] * group) == C condition holds. - if (dataShape[1] != (weightShape[1] * group)) + if (dataShape[1] != -1 && weightShape[1] != -1 && + dataShape[1] != (weightShape[1] * group)) emitError("Channel dimension mismatch"); // Note: the value of the group attribut only impacts the way the