-
Notifications
You must be signed in to change notification settings - Fork 5.9k
【Hackathon 9th Sprint No.1】add api compatibility for paddle.unique - part #76387
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 #76387 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 5
Branches ? 0
===========================================
Hits ? 5
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
|
/re-run all-failed |
|
@zhwesky2010 CI已完成需要review |
python/paddle/tensor/manipulation.py
Outdated
| Default: None. | ||
| dtype(str|paddle.dtype|np.dtype, optional): The date type of `indices` or `inverse` tensor: int32 or int64. | ||
| Default: int64. | ||
| sorted(bool, optional): Does not affect the return result, used for compatibility. |
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.
sorted=True
sorted=Fasle
两种情况下结果均一致吗
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.
|
竞品有使用吗,这个任务需要做的是对齐运算结果,不用管paddle之前怎么写的。 先提交PaConvert测试吧,比对size超过1000的结果,sorted=True/False的结果比对。 |
因为PaConvert的CI需要paddle合入之后测试,所以先提交这里,已增加PaConvert PR torch sorted=False时也会排序 |
|
torch的sorted也和paddle一样不会生效吗 |
是的torch的没有生效 |
| return_counts=False, | ||
| axis=None, | ||
| dtype="int64", | ||
| sorted=True, |
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.
这个目前应该无法实现 API完全一致吧,参数顺序不同。
group_norm也有这个问题。不过这个没法判断数据类型了,只能新增加一个paddle.compat.unique了?
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.
好的那增加paddle.compat.unique
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.
@zhwesky2010 已增加paddle.compat.unique CI完成,PaConvert PaddlePaddle/PaConvert#758 修改测试通过
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
|
/re-run all-failed |
| sorted: bool = True, | ||
| return_inverse: bool = False, | ||
| return_counts: bool = False, | ||
| dim=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.
需要添加类型提示
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加上
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?赶发版还是啥?
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.
如果修改较多,CI不容易成功,所以拆为多个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.
啊?这个 PR 涉及 API 变动,什么时候这个也要拆了?有这时间 CI 都过完了
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.
已修改
python/paddle/compat/__init__.py
Outdated
| return_inverse: bool = False, | ||
| return_counts: bool = False, | ||
| dim=None, | ||
| ) -> Tensor | tuple[Tensor, ...]: |
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.
CI容易出错,我再提交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.
已修改
Co-authored-by: Nyakku Shigure <[email protected]>
|
/re-run all-failed |



PR Category
User Experience
PR Types
New features
Description
paddle.unique 兼容性修改
返回数据可能为数组或一项,使用装饰器方式修改
sorted 参数不影响返回结果,结果始终是排序,增加参数保持兼容性