Skip to content

Commit f221917

Browse files
Skip onnx checker for new onnx version for IR3 bug (#1638)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent 4a7911b commit f221917

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/backend_test_base.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import logging
1010
import os
1111
import unittest
12+
import re
1213

1314
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
1415

@@ -278,7 +279,14 @@ def assert_shapes_correct(self, graph, allow_missing=False, run_checker=True):
278279
model_proto = graph.make_model("test")
279280

280281
if run_checker and not any(graph.get_shape(out) is None for out in graph.outputs + graph.input_names):
281-
onnx.checker.check_model(model_proto, full_check=True)
282+
try:
283+
onnx.checker.check_model(model_proto, full_check=True)
284+
except onnx.shape_inference.InferenceError as e:
285+
# onnx checker verifies number of subgraph inputs incorrectly in IR 3
286+
if re.search(r"Graph has \d* inputs but \d* were provided", str(e)):
287+
run_checker = False
288+
else:
289+
raise e
282290

283291
model_shapes = onnx.shape_inference.infer_shapes(model_proto)
284292
def get_shape(info):

0 commit comments

Comments
 (0)