broadcast_with_dims: lower-bound the dynamic output dims at 1, not 0#4927
Open
chun-wan wants to merge 1 commit into
Open
broadcast_with_dims: lower-bound the dynamic output dims at 1, not 0#4927chun-wan wants to merge 1 commit into
chun-wan wants to merge 1 commit into
Conversation
broadcast_with_dims (ONNX Expand) returns a fully-dynamic output whose
target shape is only known at runtime. It set every output dynamic
dimension to {0, SIZE_MAX}, but a broadcast output dimension is always
>= 1 (a tensor dimension cannot be 0, and Expand only ever grows a
size-1 axis). The 0 lower bound let a min-bound materialisation of the
still-dynamic output produce a degenerate zero-sized dimension
downstream (e.g. when concatenated/broadcast against a size-1 axis).
Use {1, SIZE_MAX} instead. The output is still treated as unconstrained
by consumers that key off an unbounded max (e.g. concat's wildcard
reconciliation), so this is a tightening with no functional regression;
op_shape broadcast_with_dims tests updated to the new lower bound.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4927 +/- ##
========================================
Coverage 92.66% 92.66%
========================================
Files 588 588
Lines 30397 30397
========================================
Hits 28165 28165
Misses 2232 2232
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
broadcast_with_dims (ONNX Expand) returns a fully-dynamic output whose target shape is only known at runtime. It set every output dynamic dimension to {0, SIZE_MAX}, but a broadcast output dimension is always
Use {1, SIZE_MAX} instead. The output is still treated as unconstrained by consumers that key off an unbounded max (e.g. concat's wildcard reconciliation), so this is a tightening with no functional regression; op_shape broadcast_with_dims tests updated to the new lower bound.
Motivation
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable