-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
API improvement for paddle.argsort and paddle.sort 易用性提升 #63513
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
针对 sort API: |
test/legacy_test/test_argsort_op.py
Outdated
def init(self): | ||
self.input_shape = [40, 3, 4] | ||
self.axis = 0 | ||
self.data = np.array( |
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.
这个是不是self.input_data
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.
是的,已修改
@NKNaN 看一下上面这个self.input_data,单测是不是没有测试到,其他地方没问题了 |
好的 |
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
@NKNaN custom cpu的kernel修改已经合入了,可以rerun下Py-3,如果还有问题的话,可以本地git clone CustomDevice联调下,看除了custom_kernel:ArgSortKernel的stable参数是否还有其他问题 |
已增加描述。 |
增加/删除input、增加/删除output、增加/删除attr,这几种情况是需要的 |
好的 |
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
* @param stable Indicate whether to use stable sorting algorithm, which | ||
* guarantees that the order of equivalent elements is | ||
* preserved. |
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.
注释缩进有点问题
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.
Revised here:
#63796
这个当前因为有argsort提供了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.
LGTM
@NKNaN 记得更新一下 API中文文档、API映射文档 |
好的 |
好的 |
…e#63513) * add stable to argsort and sort * update * update xpu kernel and test * update xpu test * add argsort docs code example * fix test * update op_version.yaml * fix conflict * delete additional test
…e#63513) * add stable to argsort and sort * update * update xpu kernel and test * update xpu test * add argsort docs code example * fix test * update op_version.yaml * fix conflict * delete additional test
PR Category
User Experience
PR Types
Improvements
Description
为 paddle.argsort 和 paddle.sort 支持 stable 参数,stable = True 时使用稳定排序算法,stable = False 时不保证排序算法稳定。