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 "viiccwen (via GitHub)" <gi...@apache.org> on 2026/07/14 04:10:20 UTC
[I] [Bug] Relax ONNX frontend cannot recover ConstantOfShape initializer shape with keep_params_in_input [tvm]
viiccwen opened a new issue, #20001:
URL: https://github.com/apache/tvm/issues/20001
### Expected behavior
The Relax ONNX frontend should recover initializer-backed shape inputs for `ConstantOfShape`, including when `keep_params_in_input=True`.
### Actual behavior
When the `ConstantOfShape` shape input is an initializer that is also kept as a graph input, the importer treats it as a runtime Relax expression instead of recovering the initializer value from `params`.
This prevents the frontend from deriving the output shape during import.
### Minimal pattern
```text
initializer shape = int64[1] {3}
ConstantOfShape(shape, value=int64[1] {1}) -> y
from_onnx(..., keep_params_in_input=True)
```
### Proposed fix
Apply `get_constant` to the shape input before shape handling, and only enter the constant folding path after confirming that the recovered value is a `relax.ShapeExpr`.
--
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.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: [I] [Bug] Relax ONNX frontend cannot recover ConstantOfShape initializer shape with keep_params_in_input [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex closed issue #20001: [Bug] Relax ONNX frontend cannot recover ConstantOfShape initializer shape with keep_params_in_input
URL: https://github.com/apache/tvm/issues/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: 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