Skip to content

[API Compatibility] Add alias for paddle.autograd.py_layer.once_differentiable#78539

Merged
zhwesky2010 merged 2 commits intoPaddlePaddle:developfrom
algorithm1832:improvement_once_differentiable
Apr 2, 2026
Merged

[API Compatibility] Add alias for paddle.autograd.py_layer.once_differentiable#78539
zhwesky2010 merged 2 commits intoPaddlePaddle:developfrom
algorithm1832:improvement_once_differentiable

Conversation

@algorithm1832
Copy link
Copy Markdown
Contributor

PR Category

User Experience

PR Types

Improvements

Description

  • Add alias for paddle.autograd.py_layer.once_differentiable in paddle.autograd.function
  • Add alias test

Used AI Studio

是否引起精度变化

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 31, 2026

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Mar 31, 2026
@algorithm1832
Copy link
Copy Markdown
Contributor Author

once_differentiable的功能测试没找到,尝试把torch那边的测试搬过来,不过好像不太行

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@466ed80). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

from .py_layer import PyLayerContext as FunctionCtx # noqa: F401
from .py_layer import (
PyLayerContext as FunctionCtx, # noqa: F401
once_differentiable as once_differentiable,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

名字一致就不需要as了吧

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

用as的话这个import相当于被使用了,我这么写是想绕过# noqa: F401

import paddle


class TestOnceDifferentiable(unittest.TestCase):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

比较简单,直接找到其他单测加进去吧。

PyLayer、PyLayerContext的测试等

@zhwesky2010 zhwesky2010 merged commit e26248e into PaddlePaddle:develop Apr 2, 2026
101 of 104 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants