Merged
Conversation
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the pixel_shuffle and pixel_unshuffle operations in the torch library by adding fast paths for 4D inputs and improving shape handling for higher-dimensional tensors.
- Adds early return optimization for 4D tensors that can directly use ONNX DepthToSpace/SpaceToDepth operations
- Replaces tensor slicing with explicit op.Slice calls for better shape manipulation
- Adds trace_only=True parameter to both function decorators
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2537 +/- ##
==========================================
- Coverage 69.93% 69.93% -0.01%
==========================================
Files 216 216
Lines 26048 26052 +4
Branches 2614 2616 +2
==========================================
+ Hits 18217 18219 +2
Misses 6931 6931
- Partials 900 902 +2 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
titaiwangms
approved these changes
Sep 3, 2025
titaiwangms
approved these changes
Sep 3, 2025
justinchuby
commented
Sep 3, 2025
justinchuby
commented
Sep 3, 2025
titaiwangms
approved these changes
Sep 3, 2025
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.
Simplify the graph when input rank is 4, in which case we don't need to do any shape manipulation.
Fix pytorch/pytorch#162061