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: [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]