-
Notifications
You must be signed in to change notification settings - Fork 6k
[Cpp API Compatibility] Remove contiguous in at::Tensor::index
#78182
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
Merged
SigureMo
merged 10 commits into
PaddlePaddle:develop
from
ShigureNyako:bugfix/remove-contiguous-index-develop
Mar 12, 2026
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e7e6e08
[compat] Remove contiguous in ATen index
ShigureNyako 0ef874f
[BugFix] Fix codestyle in ATen index test
ShigureNyako c60c6d8
Merge upstream/develop into bugfix/remove-contiguous-index-develop
ShigureNyako 11ca671
[compat] Fix ATen index slice test overload
ShigureNyako d374919
[compat] Add TensorIndex-based ATen index API
ShigureNyako 274fd01
[compat] Fix ATen index overload conflicts
ShigureNyako c09a9fc
[compat] Fix ATen index codestyle
ShigureNyako 4af9740
Fix SymInt conversion in ATen index compat path
ShigureNyako c426693
test: cover ATen index compat paths
ShigureNyako 26618fd
[compat] Fix ATen index test clang-format
ShigureNyako 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -551,8 +551,8 @@ class Tensor : public TensorBase { | |
| ::std::optional<int64_t> end = ::std::nullopt, | ||
| int64_t step = 1); | ||
|
|
||
| // TODO(wangyanpeng04): modify the api to | ||
| // Tensor index(ArrayRef<at::indexing::TensorIndex> indices) const; | ||
| at::Tensor index( | ||
| std::initializer_list<at::indexing::TensorIndex> indices) const; | ||
| at::Tensor index(const std::vector<at::indexing::Slice>& indices) const; | ||
|
||
|
|
||
| at::Tensor& floor_divide_(const at::Scalar& other) const { | ||
|
|
||
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
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.
不是,
at::Tensor index(ArrayRef<at::indexing::TensorIndex> indices) const;呢?怎么删了?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.
另外 CI codestyle 处理下