diff --git a/python/paddle/__init__.py b/python/paddle/__init__.py index 6d482785e95a65663a075e3034891874ddb1a527..0d7169251a7cda9639ec7a852931aefabed6358b 100755 --- a/python/paddle/__init__.py +++ b/python/paddle/__init__.py @@ -255,9 +255,9 @@ from .framework import CUDAPlace # noqa: F401 from .framework import NPUPlace # noqa: F401 from .framework import CUDAPinnedPlace # noqa: F401 -from .framework import grad # noqa: F401 -from .framework import no_grad # noqa: F401 -from .framework import set_grad_enabled # noqa: F401 +from .autograd import grad # noqa: F401 +from .autograd import no_grad # noqa: F401 +from .autograd import set_grad_enabled # noqa: F401 from .framework import save # noqa: F401 from .framework import load # noqa: F401 from .framework import DataParallel # noqa: F401 diff --git a/python/paddle/autograd/__init__.py b/python/paddle/autograd/__init__.py index 569619f065a051d071eb8be6b8d8f63049b20d2f..89094357b35050c24949b8fe27ef73f222b21611 100644 --- a/python/paddle/autograd/__init__.py +++ b/python/paddle/autograd/__init__.py @@ -16,5 +16,7 @@ from ..fluid.dygraph.base import grad # noqa: F401 from . import backward_mode # noqa: F401 from .backward_mode import backward # noqa: F401 from .py_layer import PyLayer, PyLayerContext # noqa: F401 +from ..framework import set_grad_enabled # noqa: F401 +from ..fluid.dygraph.base import no_grad_ as no_grad # noqa: F401 -__all__ = ['grad', 'backward', 'PyLayer', 'PyLayerContext'] +__all__ = ['backward', 'PyLayer', 'PyLayerContext']