Repository navigation
IotaSimplify: an iota along a dimension of size 1 is a splat 0 - #3412
Merged
Merged
Conversation
Counting along a dimension of size 1 never gets past 0, so such an iota is a zero constant at any size; fold it even above the constant expansion threshold, where a counting iota is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3412 +/- ##
==========================================
- Coverage 29.61% 27.88% -1.74%
==========================================
Files 240 240
Lines 48460 48483 +23
==========================================
- Hits 14351 13518 -833
- Misses 34109 34965 +856 ☔ View full report in Codecov by Harness. 🚀 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.
An iota along a dimension of size 1 is all zeros.
IotaSimplifynow folds it to a splat0at any size. Before, iotas were only folded to constants below themax_constant_expansionthreshold, so a large one such astensor<1x2048xi64>stayed an iota.This follows up #3410. With this change, a broadcast of a size-1 iota folds to a zero constant through the iota itself.
iota_unit_dim.mlircovers an integer case and a float case above the threshold, plus a counting iota above the threshold that is still left alone.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD