Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0a4401

Browse files
authoredApr 22, 2025··
Fix optimizer tests (#2217)
Fix optimizer tests by turning on onnx shape inference. This is needed to elimininate an If node that is causing ORT to crash (microsoft/onnxruntime#24473). I removed the argument because shape inference is default.
1 parent 6867e44 commit b0a4401

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎tests/optimizer/test_models.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
from onnxscript.rewriter import onnxruntime as ort_rewriter
1717
from onnxscript.utils import evaluation_utils
1818

19-
_SKIP_TABLE = {
20-
"resnet18": "fixme: ORT aborts when loading the model - https://github.com/microsoft/onnxruntime/issues/24473",
21-
"mobilenetv2_100": "fixme: ORT aborts when loading the model - https://github.com/microsoft/onnxruntime/issues/24473",
22-
}
19+
_SKIP_TABLE = {}
2320

2421
model_folder_path = (
2522
pathlib.Path(__file__).resolve().parent.parent.parent / "testdata" / "e2e_models"
@@ -41,7 +38,7 @@ def test_model_runs_and_matches_accuracy_after_optimization(self, model_name):
4138
if not model_path.exists():
4239
self.skipTest(f"Model {model_name!r} does not exist")
4340
model = onnx.load(model_path)
44-
model = optimizer.optimize(model, onnx_shape_inference=False)
41+
model = optimizer.optimize(model)
4542

4643
with tempfile.TemporaryDirectory() as tmp_folder:
4744
tmp_folder = pathlib.Path(tmp_folder)

0 commit comments

Comments
 (0)
Please sign in to comment.