Skip to content

[FIX][Relax][ONNX] Preserve input extents in symbolic Expand - #21119

Open
sunni13830 wants to merge 1 commit into
apache:mainfrom
sunni13830:fix/onnx-expand-symbolic-target
Open

sunni13830 wants to merge 1 commit into
apache:mainfrom
sunni13830:fix/onnx-expand-symbolic-target

Conversation

@sunni13830

Copy link
Copy Markdown

Summary

Expand can receive a symbolic target extent from Shape. If that extent is one at runtime, preserve the corresponding known non-unit input extent, as ONNX multidirectional broadcasting requires. This fixes a case where expanding an input of shape [3, 1] with a runtime target of [1, 2] drops two rows.

Closes #20897.

Tests

All five Expand tests pass in the local LLVM-enabled TVM environment. The new ONNX Runtime comparisons cover a fixed target and a symbolic target evaluated at one and at the input extent. The symbolic singleton case fails on the original converter.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Relax][ONNX] Expand uses a symbolic requested shape without merging broadcast dimensions

1 participant