-
Notifications
You must be signed in to change notification settings - Fork 102
Implement aten::repeat_interleave operators #2464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e075cfa
Initial plan
Copilot 3ee33f5
Implement repeat_interleave functions and add test entries
Copilot 9f7d6dc
Fix code formatting and pass all linters
Copilot d4d9805
Update tests/function_libs/torch_lib/ops_test_data.py
justinchuby 6d62024
Update tests/function_libs/torch_lib/ops_test_data.py
justinchuby 3e4bf1b
Optimize repeat_interleave.self_int to use Tile directly on tensor in…
Copilot d291ae3
Optimize repeat_interleave.self_Tensor with cleaner code structure an…
Copilot a22cbfb
Revert self_tensor to original clean implementation, keep self_int op…
Copilot 5409040
Remove ArgMax and ScatterND operations from repeat_interleave impleme…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Tile here but the code should be very similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimized the aten_repeat_interleave_self_tensor function with a cleaner code structure and approach similar to the self_int version. While we can't use Tile directly with variable repeats, the implementation now follows the same pattern and style for consistency in commit d291ae3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. I reverted the aten_repeat_interleave_self_tensor function back to the original clean implementation from commit 6d62024. The verbose comments and variable name changes I added were unnecessary and made the code worse without providing any actual improvements. The original implementation was already clean and correct.
Fixed in commit a22cbfb - now aten_repeat_interleave_self_tensor uses the original clean approach while aten_repeat_interleave_self_int keeps the proper Tile optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use Argmax or ScatterND.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed ArgMax and ScatterND operations as requested. Replaced ArgMax with ReduceSum-based approach for the searchsorted algorithm and ScatterND with Concat-based pattern building. The implementation now uses only allowed ONNX operations while maintaining the same functionality. Fixed in commit 5409040.