-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API Compatibility] add out for topk
#74887
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
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #74887 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 9
Branches ? 0
===========================================
Hits ? 9
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
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
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
| out_values, out_indices = out | ||
| out_values = paddle.assign(values, output=out_values) | ||
| out_indices = paddle.assign(indices, output=out_indices) | ||
| return out_values, out_indices |
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.
下个PR可以看下这个返回类型的问题:torch的返回类型是torch.return_types.topk
我们针对这个也封装了相应数据结构:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/compat.py#L222
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.
补充PR:#74931
PR Category
User Experience
PR Types
Others
Description
topk增加别名装饰器,使用assign来实现out参数;


amaxamin在之前已经完成了下沉,这个pr补充文档、单测pcard-71500