-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API Compatibilities] add return_type for topk
#74931
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 #74931 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 2
Lines ? 9
Branches ? 0
===========================================
Hits ? 9
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
topktopk
zhwesky2010
left a comment
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
| sorted: bool = True, | ||
| name: str | None = None, | ||
| *, | ||
| out: tuple[Tensor, Tensor] | None = None, |
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.
确认一下,这里的 out 的类型和输出不是一样的么?
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.
median 同样
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.
- 这个out是由用户传进来的,类型可以不是Namedtuple,但输出一定是Namedtuple。
- torch的文档中也只是表明这个out参数得是
(Tensor, Tensor),并没有更进一步的要求。
可能写out=None更好些?
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.
median 同样
不是一样的,median、sort、min、max、topk这几个返回的都是两个Tensor,都像torch一样封装了返回类型。
PR Category
User Experience
PR Types
Others
Description
add return_type for
topkand fixcompat.median's return_typecc @zhwesky2010
pcard-71500