-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[zero-dim] Support 0-d for kthvalue and mode #49340
[zero-dim] Support 0-d for kthvalue and mode #49340
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
kthvalue和mode的axis应该限制None,0,-1。然后kthvalue应该还有k值的限制为1
输入其他值应该报错,可以和竞品对比下
2ca67bf
to
e08ba7f
Compare
kthvalue的部分:
mode的部分:
|
|
||
out = paddle.kthvalue(x, 1) | ||
out[0].backward() | ||
self.assertEqual(out[0].shape, []) |
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.
动态图还需要测下反向grad的shape,把具体值也测下吧,因为比较固定
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.
Done, thanks
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
PR types
New features
PR changes
OPs
Describe
This PR is same with #49122 and fix the bug on Windows.
The original PR will met unittest error on Windows and already been reverted. This is because the flag
is_runtime
is different with Linux.