[API Compatibility No.122] Align paddle.neg with PyTorch API#78216
Open
seasameye wants to merge 2 commits intoPaddlePaddle:developfrom
Open
[API Compatibility No.122] Align paddle.neg with PyTorch API#78216seasameye wants to merge 2 commits intoPaddlePaddle:developfrom
seasameye wants to merge 2 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
zhwesky2010
reviewed
Mar 8, 2026
| np.testing.assert_allclose(fetches[i + 1], ref_out[1]) | ||
|
|
||
|
|
||
| class TestDsplitAPI(unittest.TestCase): |
Contributor
There was a problem hiding this comment.
这些不是这个PR的修改内容,拉下最新develop,处理下冲突
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #78216 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 8
Branches ? 0
===========================================
Hits ? 8
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zhwesky2010
requested changes
Mar 9, 2026
|
|
||
|
|
||
| # Test row_stack compatibility | ||
| class TestRowStackAPI(unittest.TestCase): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
User Experience
PR Types
Improvements
Description
本次修改增强了 Paddle 的
paddle.negAPI 与 PyTorch 的兼容性,便于 PyTorch 代码无缝迁移到 Paddle。主要改动:
参数别名支持
neg添加@param_one_alias(["x", "input"])装饰器。input可作为x的别名out 参数支持
out: Tensor | None = None。out,计算结果写入预分配张量;否则返回计算结果。out张量直接传入算子。文档更新
Alias: ``input``.out参数说明与使用示例。测试补充
test/legacy_test/test_api_compatibility.py中新增TestNeg测试类。是否引起精度变化
否