You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "Kevin-Li-2025 (via GitHub)" <gi...@apache.org> on 2026/06/17 18:22:37 UTC
[PR] Preserve ONNX BatchNormalization inference mode [tvm]
Kevin-Li-2025 opened a new pull request, #19818:
URL: https://github.com/apache/tvm/pull/19818
### Description
Fixes #19574.
ONNX `BatchNormalization` defaults `training_mode` to integer `0`, while Relax `nn.batch_norm` expects a boolean `training` attribute. Passing the integer through lets the imported op carry a non-bool training attr and can route default ONNX BatchNormalization through training-mode semantics instead of inference/running-stat semantics.
This converts the ONNX attribute to `bool` before constructing `relax.op.nn.batch_norm`, and adds an importer-level regression test that verifies default ONNX BatchNormalization is imported with `training is False`.
### Tests
- `python3 -m py_compile python/tvm/relax/frontend/onnx/onnx_frontend.py tests/python/relax/test_frontend_onnx.py`
- Static regression check confirming the bool conversion and new frontend test
- `git diff --check`
The full TVM Python test cannot run in this local checkout because `tvm_ffi` is not built/installed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] Preserve ONNX BatchNormalization inference mode [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex merged PR #19818:
URL: https://github.com/apache/tvm/pull/19818
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org