Skip to content

Commit ebbb1cf

Browse files
committed
1 parent ce12f0e commit ebbb1cf

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

onnxscript/tests/function_libs/torch_lib/ops_test_common.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,12 @@ def _capture_graph_and_evaluate_torch_script_evaluator(function: Callable, args,
513513

514514
onnx_model = onnxscript_graph.to_model_proto(TEST_OPSET_VERSION)
515515
# Make sure the model is valid
516-
# try:
517-
# onnx.checker.check_model(onnx_model, full_check=True)
518-
# except (onnx.checker.ValidationError, onnx.shape_inference.InferenceError) as e:
519-
# raise AssertionError(
520-
# f"ONNX model is invalid. Model:\n{onnxscript.proto2text(onnx_model)}"
521-
# ) from e
522-
523-
print(onnxscript.proto2text(onnx_model))
516+
try:
517+
onnx.checker.check_model(onnx_model, full_check=True)
518+
except (onnx.checker.ValidationError, onnx.shape_inference.InferenceError) as e:
519+
raise AssertionError(
520+
f"ONNX model is invalid. Model:\n{onnxscript.proto2text(onnx_model)}"
521+
) from e
524522

525523
try:
526524
if os.environ.get("CATCH_ORT_SEGFAULT") == "1":

0 commit comments

Comments
 (0)