-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API-Compat] paddle.compat.split is added and tested #74446
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提交成功,感谢你对开源项目的贡献! |
|
/re-run all-failed |
Codecov Report❌ Patch coverage is Please upload reports for the commit 3ec6b4d to get more accurate results.
❌ Your patch status has failed because the patch coverage (81.55%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #74446 +/- ##
==========================================
Coverage ? 81.55%
==========================================
Files ? 4
Lines ? 103
Branches ? 0
==========================================
Hits ? 84
Misses ? 19
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* ADD Check chinese * ADD Check chinese * Update
* [XPU] support python streams api for xpu * [XPU] support python streams api for xpu * [XPU] add stream & event unittests
* fix: fix normalization logic in p_norm kernels * Code Formatting * zancun * fix_dist_normalize * back * huifu zhushi * pre-commit * Fix code style * Standardize code comments
* fix * fix * fix * revert set_tensor support stridecopy * fix
* add tensor.bool * add tensor.bool test * update tensor.bool test * update tensor.bool * delete useless test code * add dtype conversions method * skip the complex128 test on XPU * fix: Implement the byte function separately * fix: update unit testing
* add msort api * change msort api without out param * replace msort param x with input * change copyright time
* add paddle.ravel * fix test case * fix typo
* Run XPU Paddlex
* Update README.md * Create README_cn.md Add Chinese documentation * Update README.md * Update README_cn.md
PR Category
Operator Mechanism
PR Types
New features
Description
增加了
paddle.compat.split。此 API 的函数签名、行为与torch.split完全一致。具体见torch.split文档以及后续更新的 paddle doc。增加了如下机制:split_size_or_sections在各种情况下(动、静态图)正确计算num_or_sections的方法。此API不再要求分成相同大小的 tensor(最后一个tensor可以略小,取决于 int 类型的 split size 是否能整除 shape 对应维度)。forbid_keywords装饰器:此装饰器接收一个或者多个禁止用户输入(可能混淆)的 keyword arguments,并接收一个“建议调用函数的名称”。当用户输入错误的 keyword arguments 时,将会报错提示。例子:报错如下:
对于
paddle.compat.split误用为paddle.split同样有此操作。test_compat_split.py用于测试输入输出 shape,size 以及是否能正确报错Pcard-89620