Skip to content

Commit

Permalink
[ONNX] Fix test to disable default ONNX frontend constant folding (#1…
Browse files Browse the repository at this point in the history
…2532)

In TVM ONNX frontend, constants are folded by default, which makes `test_load_model__onnx` to fail because it is looking for "params" that were already converted into constants.

This patch fixes the test to disable constant folding so that we can assert that "params" in the model are present as expected.
  • Loading branch information
leandron authored Aug 22, 2022
1 parent 8146a9b commit 48a8cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/python/driver/tvmc/test_frontends.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def verify_load_model__onnx(model, **kwargs):
def test_load_model__onnx(onnx_resnet50):
# some CI environments wont offer onnx, so skip in case it is not present
pytest.importorskip("onnx")
tvmc_model = verify_load_model__onnx(onnx_resnet50)
tvmc_model = verify_load_model__onnx(onnx_resnet50, freeze_params=False)
# check whether one known value is part of the params dict
assert "resnetv24_batchnorm0_gamma" in tvmc_model.params.keys()
tvmc_model = verify_load_model__onnx(onnx_resnet50, freeze_params=True)
Expand Down

0 comments on commit 48a8cbd

Please sign in to comment.