[Negative indexing] Support negative indices for all operators in the scatter/gather series.#68780
Merged
HydrogenSulfate merged 21 commits intoPaddlePaddle:developfrom Oct 21, 2024
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
12 tasks
…er unitest for converage
zyfncg
approved these changes
Oct 21, 2024
luotao1
approved these changes
Oct 21, 2024
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.
PR Category
User Experience
PR Types
Bug fixes
Description
Pcard-75624
相关PR:deepmodeling/deepmd-kit#4157
为数据操作/索引操作类的算子及其反向算子支持负数索引(即从仅支持$[0, S)$ 内的非负整数,升级为支持 $[-S, S)$ 范围内的所有整数作为索引值, $S$ 表示运算输入x的形状在axis维度上的大小,即索引值的上限),以及修复负数axis的支持(个别算子对axis为-1这种负数没有处理逻辑导致报错,这里统一修复了),具体包括以下7个算子:
Tensor.__getitem__(上述6个算子支持负数索引后即可实现)具体包括以下修改: