[API Compatibility No.114] support torch-style kwarg input for paddle.masked_fill via decorator -part#77801
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
ccc83c9 to
8e079fd
Compare
b620033 to
919b885
Compare
201d91c to
0a2db70
Compare
| ) | ||
| paddle.enable_static() | ||
|
|
||
| def test_dygraph_duplicate_args(self): |
There was a problem hiding this comment.
已删除 test_dygraph_duplicate_args 测试方法。
|
|
||
|
|
||
| # Test masked_fill compatibility | ||
| class TestMaskedFillAPI(unittest.TestCase): |
There was a problem hiding this comment.
挪到上面去,随机一个位置,不然很容易发生冲突
There was a problem hiding this comment.
已将 TestMaskedFillAPI 挪到 TestSquareAPI 之后(文件中间位置),避免冲突。
….masked_fill via decorator -part Add @param_one_alias(["x", "input"]) decorator on masked_fill() to support PyTorch-style paddle.masked_fill(input=x, mask=mask, value=v). Use decorator approach instead of C++ sink (python_api_info.yaml) because masked_fill's C++ op requires Tensor value but the Python API accepts scalar, and C++ sink would bypass the scalar-to-Tensor conversion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0a2db70 to
44b2d55
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #77801 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 1
Branches ? 0
===========================================
Hits ? 1
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@PaddlePaddle/ci-team 这次 #77801 做了两次 no-code 重新触发后,原先的 Linux-XPU/Linux-build/Mac-CPU 均已通过,但出现两个连续的非代码类失败,申请协助基础设施侧处理或管理员重跑:
PR 本次代码未改动(仅空提交触发 CI)。请帮忙看下是否可按 infra 波动处理并重跑,谢谢。 |
|
/re-run all-failed |
|
/re-run slice |
5ab19d7 to
1690f05
Compare
|
/re-run all-failed |
PR Category
User Experience
PR Types
New features
Description
Add PyTorch-style
inputkeyword argument alias forpaddle.masked_fillvia@param_one_alias(["x", "input"])decorator.After this PR, the following calls are equivalent:
paddle.masked_fill(x, mask, value)paddle.masked_fill(x=x, mask=mask, value=value)paddle.masked_fill(input=x, mask=mask, value=value)(PyTorch style)C++ sink (python_api_info.yaml) is not viable because masked_fill's C++ op requires Tensor value but the Python API accepts scalar; registering via yaml bypasses the scalar-to-Tensor conversion.
Related Issue: #76301 (Task No.114)
是否引起精度变化
否