未验证 提交 888b8b6b 编写于 作者: 张春乔 提交者: GitHub

[CodeStyle][PLC0414] remove self-alias and some discussion (#52122)

上级 e7c249cb
...@@ -120,7 +120,7 @@ select = [ ...@@ -120,7 +120,7 @@ select = [
# "B904", # "B904",
# Pylint # Pylint
# "PLC0414", "PLC0414",
# "PLC1901", # "PLC1901",
"PLC3002", "PLC3002",
"PLE0100", "PLE0100",
......
...@@ -42,7 +42,7 @@ from .fluid.lazy_init import LazyGuard # noqa: F401 ...@@ -42,7 +42,7 @@ from .fluid.lazy_init import LazyGuard # noqa: F401
from .framework.dtype import iinfo # noqa: F401 from .framework.dtype import iinfo # noqa: F401
from .framework.dtype import finfo # noqa: F401 from .framework.dtype import finfo # noqa: F401
from .framework.dtype import dtype as dtype # noqa: F401 from .framework.dtype import dtype # noqa: F401
from .framework.dtype import uint8 # noqa: F401 from .framework.dtype import uint8 # noqa: F401
from .framework.dtype import int8 # noqa: F401 from .framework.dtype import int8 # noqa: F401
from .framework.dtype import int16 # noqa: F401 from .framework.dtype import int16 # noqa: F401
......
...@@ -19,8 +19,8 @@ from ..fluid.dygraph.base import is_grad_enabled # noqa: F401 ...@@ -19,8 +19,8 @@ from ..fluid.dygraph.base import is_grad_enabled # noqa: F401
from ..fluid.dygraph.base import set_grad_enabled # noqa: F401 from ..fluid.dygraph.base import set_grad_enabled # noqa: F401
from . import backward_mode # noqa: F401 from . import backward_mode # noqa: F401
from .backward_mode import backward # noqa: F401 from .backward_mode import backward # noqa: F401
from .py_layer import PyLayer as PyLayer # noqa: F401 from .py_layer import PyLayer # noqa: F401
from .py_layer import PyLayerContext as PyLayerContext # noqa: F401 from .py_layer import PyLayerContext # noqa: F401
from .saved_tensors_hooks import saved_tensors_hooks from .saved_tensors_hooks import saved_tensors_hooks
__all__ = [ # noqa __all__ = [ # noqa
......
...@@ -371,9 +371,7 @@ class ParameterServerOptimizer(MetaOptimizerBase): ...@@ -371,9 +371,7 @@ class ParameterServerOptimizer(MetaOptimizerBase):
_origin_main_program = loss.block.program _origin_main_program = loss.block.program
_origin_startup_program = startup_program _origin_startup_program = startup_program
from paddle.incubate.distributed.fleet.parameter_server.ir import ( from paddle.incubate.distributed.fleet.parameter_server.ir import public
public as public,
)
compiled_config = public.CompileTimeStrategy( compiled_config = public.CompileTimeStrategy(
_origin_main_program, _origin_main_program,
......
...@@ -19,7 +19,7 @@ import numpy as np ...@@ -19,7 +19,7 @@ import numpy as np
import paddle import paddle
from paddle.distribution.transformed_distribution import TransformedDistribution from paddle.distribution.transformed_distribution import TransformedDistribution
from paddle.fluid import framework as framework from paddle.fluid import framework
class Gumbel(TransformedDistribution): class Gumbel(TransformedDistribution):
......
...@@ -18,7 +18,7 @@ import numpy as np ...@@ -18,7 +18,7 @@ import numpy as np
import paddle import paddle
from paddle.distribution import distribution from paddle.distribution import distribution
from paddle.fluid import framework as framework from paddle.fluid import framework
class Laplace(distribution.Distribution): class Laplace(distribution.Distribution):
......
...@@ -445,7 +445,7 @@ class DnnTrainer: ...@@ -445,7 +445,7 @@ class DnnTrainer:
"entering run {} - old".format(str(config["applied_pass_name"])) "entering run {} - old".format(str(config["applied_pass_name"]))
) )
from paddle.incubate.distributed.fleet.parameter_server.ir import ( from paddle.incubate.distributed.fleet.parameter_server.ir import (
public as public, public,
) )
dist_strategy = get_distributed_strategy(user_defined_strategy) dist_strategy = get_distributed_strategy(user_defined_strategy)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import unittest as unittest import unittest
from paddle import fluid from paddle import fluid
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import unittest as unittest import unittest
from paddle import fluid from paddle import fluid
......
...@@ -17,7 +17,7 @@ import typing ...@@ -17,7 +17,7 @@ import typing
from collections import OrderedDict from collections import OrderedDict
import paddle import paddle
from paddle.fluid import framework as framework from paddle.fluid import framework
from paddle.fluid.core import prim_config from paddle.fluid.core import prim_config
from paddle.fluid.framework import Operator, default_main_program from paddle.fluid.framework import Operator, default_main_program
from paddle.incubate.autograd.utils import as_tensors from paddle.incubate.autograd.utils import as_tensors
......
...@@ -15,7 +15,7 @@ import typing ...@@ -15,7 +15,7 @@ import typing
import paddle import paddle
import paddle.framework.dtype as dtypes import paddle.framework.dtype as dtypes
from paddle.fluid import framework as framework from paddle.fluid import framework
from .phi_ops_map import op_info, op_map from .phi_ops_map import op_info, op_map
......
...@@ -75,7 +75,7 @@ from paddle.incubate.distributed.fleet.parameter_server.ir import ( ...@@ -75,7 +75,7 @@ from paddle.incubate.distributed.fleet.parameter_server.ir import (
pserver_pass as server, pserver_pass as server,
) )
from paddle.incubate.distributed.fleet.parameter_server.ir import ( from paddle.incubate.distributed.fleet.parameter_server.ir import (
public as public, public,
) )
......
...@@ -1485,7 +1485,7 @@ def main(): ...@@ -1485,7 +1485,7 @@ def main():
else: else:
env_dict_path = TOP_DIR + "/build/python/" env_dict_path = TOP_DIR + "/build/python/"
sys.path.insert(1, env_dict_path) sys.path.insert(1, env_dict_path)
from env_dict import env_dict as env_dict from env_dict import env_dict
global env_dict global env_dict
global paddle_binary_dir, paddle_source_dir global paddle_binary_dir, paddle_source_dir
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册