Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for various tensor operations in the ATen/PyTorch C++ API, specifically focusing on split, select, reciprocal, and detach operations.
Changes:
- Added tests for multiple split-related operations (split, split_with_sizes, unsafe_split, unsafe_split_with_sizes, tensor_split, hsplit, vsplit, dsplit)
- Added tests for tensor selection operations (select, select_symint)
- Added tests for reciprocal operations (reciprocal, reciprocal_, global reciprocal function)
- Added tests for tensor detach operations (detach, detach_)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| test/ops/SplitTest.cpp | Implements 16 test cases covering various split operations including basic split, split by sizes, unsafe split variants, tensor_split, and dimensional splits (hsplit, vsplit, dsplit) |
| test/ops/SelectTest.cpp | Implements 10 test cases for tensor selection operations including dimension selection, negative indexing, chained selection, and SymInt variants |
| test/ops/ReciprocalTest.cpp | Implements 5 test cases for reciprocal operations including basic reciprocal, in-place variant, various values, multi-dimensional tensors, and global function |
| test/ops/DetachTest.cpp | Implements 5 test cases for tensor detach operations including basic detach, in-place variant, modification tests, and multi-dimensional tensors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,221 @@ | |||
| #include <ATen/ATen.h> | |||
There was a problem hiding this comment.
The PR description mentions adding tests for masked_select, but no test file for this function is included in the changes. Either the test file is missing, or the PR description should be updated to remove the mention of masked_select.
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.
更新 tensor_base 文档