[API Compatibility] Add alias for paddle.autograd.py_layer.once_differentiable#78539
Merged
zhwesky2010 merged 2 commits intoPaddlePaddle:developfrom Apr 2, 2026
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #78539 +/- ##
===========================================
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:
|
zhwesky2010
reviewed
Apr 1, 2026
python/paddle/autograd/function.py
Outdated
| from .py_layer import PyLayerContext as FunctionCtx # noqa: F401 | ||
| from .py_layer import ( | ||
| PyLayerContext as FunctionCtx, # noqa: F401 | ||
| once_differentiable as once_differentiable, |
Contributor
Author
There was a problem hiding this comment.
用as的话这个import相当于被使用了,我这么写是想绕过# noqa: F401
| import paddle | ||
|
|
||
|
|
||
| class TestOnceDifferentiable(unittest.TestCase): |
Contributor
There was a problem hiding this comment.
比较简单,直接找到其他单测加进去吧。
PyLayer、PyLayerContext的测试等
zhwesky2010
approved these changes
Apr 2, 2026
liuhao2638
pushed a commit
to liuhao2638/Paddle
that referenced
this pull request
Apr 7, 2026
…erentiable` (PaddlePaddle#78539) * add alias for once_differentiable * move test
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.autograd.py_layer.once_differentiableinpaddle.autograd.functionUsed AI Studio
是否引起精度变化
否