-
Notifications
You must be signed in to change notification settings - Fork 275
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
Hackathon No.16】add RFC for take API #217
Merged
Merged
Conversation
This file contains 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 was referenced Aug 22, 2022
luotao1
reviewed
Aug 23, 2022
2. 根据 mode 参数对索引进行越界处理: | ||
- `mode='raise'`, 直接抛出错误 (默认); | ||
- `mode='wrap'`, 通过取余约束越界的 indices; | ||
- `mode='clip'`, 通过 `paddle.clip` 约束两端的索引。 |
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.
- 需要在业内方案调研的Numpy实现方法里,补充下mode参数的越界处理的逻辑和核心代码
- raise抛出错误,不是在mode参数阶段抛出的,是在后面的index_select地方抛出,这里的描述不够准确
- 需要说明下wrap是用哪个API来完成处理的。
- 因为Clip: Note that this disables indexing with negative numbers.有这个限制,需要说明下直接使用paddle.clip是否符合要求
Reply: #217 (comment) RFC 增加了 numpy.take 的 mode 参数的核心代码以及总结。
|
luotao1
approved these changes
Aug 29, 2022
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.
LGTM
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.
为 paddle 新增 take API。
根据 PaddlePaddle/community#186 (review) 重新修改了本 RFC 和 PR PaddlePaddle/Paddle#44741 。