Skip to content
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

【Hackathon 6th No.10】Add isin API to Paddle #884

Merged
merged 2 commits into from
May 9, 2024

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Apr 28, 2024

新增 paddle.isin API的设计文档

Copy link

paddle-bot bot commented Apr 28, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

用现有API组合实现

## API实现方案
参考 pytorch 在 _decompose 中的设计:当 test_elements 元素个数较少时直接进行暴力搜索,较多时则采取基于排序的算法:若assume_unique=True,则用(利用 flatten,concat,index_put_,searchsorted等API组合实现)。暂时去掉 assume_unique 参数,因为**当前 paddle 的 argsort kernel 使用的是 std::sort 的不稳定排序,与 pytorch 和 numpy 的结果就会存在差异。若后期需要加 assume_unique 参数并用 argsort 实现 isin,则需要先实现 stable 的 argsort。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一段是不是要改改,现在应该是明确方案了吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@luotao1 luotao1 merged commit 83ae89c into PaddlePaddle:master May 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants