-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Remove autograd/grad api #35579
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
Remove autograd/grad api #35579
Conversation
Thanks for your contribution! |
@@ -17,4 +17,4 @@ | |||
from .backward_mode import backward # noqa: F401 | |||
from .py_layer import PyLayer, PyLayerContext # noqa: F401 | |||
|
|||
__all__ = ['grad', 'backward', 'PyLayer', 'PyLayerContext'] | |||
__all__ = ['backward', 'PyLayer', 'PyLayerContext'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1、兼容性影响较小,从__all__列表中删除只影响import *,相对使用很少。对于autograd.grad这类使用不受影响。
2、建议paddle.grad 修改从fluid import 改为从autograd import,fluid是非标准路径是计划会废弃的
3、包括no_grad、set_grad_enabled也建议从autograd import,这部分代码有计划从fluid迁移到autograd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
64a7173
to
d72d5bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* remove autograd/grad api * import grad, no_grad set_grad_enable from autograd module * modify import no_grad_ as no_grad
PR types
Others
PR changes
APIs
Describe
Remove the grad API in paddle/autograd/__init__.py