Skip to content

Conversation

MingMingShangTian
Copy link
Contributor

@MingMingShangTian MingMingShangTian commented Sep 8, 2021

PR types

Others

PR changes

APIs

Describe

Remove the grad API in paddle/autograd/__init__.py

@paddle-bot-old
Copy link

paddle-bot-old bot commented Sep 8, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

TCChenlong
TCChenlong previously approved these changes Sep 8, 2021
@@ -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']
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@zhiboniu zhiboniu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

lgtm

@MingMingShangTian MingMingShangTian merged commit 7d9ca16 into PaddlePaddle:develop Sep 16, 2021
@MingMingShangTian MingMingShangTian deleted the rm_autograd_grad_api branch September 16, 2021 08:22
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
* remove autograd/grad api

* import grad, no_grad set_grad_enable from autograd module

* modify import no_grad_ as no_grad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants