viiccwen opened a new pull request, #20002: URL: https://github.com/apache/tvm/pull/20002
`ConstantOfShape` uses its input tensor as shape metadata. When that input is an initializer and `keep_params_in_input=True`, the Relax ONNX frontend should recover the initializer value from `params` instead of treating the input as an opaque runtime value. This patch applies `get_constant` to the `ConstantOfShape` shape input before shape handling. It also guards the constant-shape folding path so it only calls `len(shape)` on `relax.ShapeExpr` values. The regression test covers an initializer-backed shape input imported with `keep_params_in_input=True` and checks that the resulting Relax function has the expected output shape and dtype. A separate lint follow-up commit removes stale `F821` suppressions from two DLight files so the repository-wide CI lint is clean. Verification: - `python -m pytest tests/python/relax/test_frontend_onnx.py::test_constantofshape_initializer_shape_with_keep_params_in_input -q` - `pre-commit run --all-files` Fixes #20001. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
