未验证 提交 499d2daf 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][F403] expand star import (#46946)

上级 de6e7431
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
try: try:
from paddle.version import full_version as __version__ from paddle.version import full_version as __version__
from paddle.version import commit as __git_commit__ from paddle.version import commit as __git_commit__
from paddle.cuda_env import * from paddle.cuda_env import * # noqa: F403
except ImportError: except ImportError:
import sys import sys
sys.stderr.write('''Warning with import paddle: you should not sys.stderr.write('''Warning with import paddle: you should not
...@@ -35,7 +35,7 @@ from .framework import set_flags # noqa: F401 ...@@ -35,7 +35,7 @@ from .framework import set_flags # noqa: F401
from .framework import disable_static # noqa: F401 from .framework import disable_static # noqa: F401
from .framework import enable_static # noqa: F401 from .framework import enable_static # noqa: F401
from .framework import in_dynamic_mode # noqa: F401 from .framework import in_dynamic_mode # noqa: F401
from .fluid.dataset import * # noqa: F401 from .fluid.dataset import * # noqa: F401, F403
from .fluid.lazy_init import LazyGuard # noqa: F401 from .fluid.lazy_init import LazyGuard # noqa: F401
from .framework.dtype import iinfo # noqa: F401 from .framework.dtype import iinfo # noqa: F401
......
...@@ -51,7 +51,7 @@ from .collective import batch_isend_irecv # noqa: F401 ...@@ -51,7 +51,7 @@ from .collective import batch_isend_irecv # noqa: F401
from .collective import P2POp # noqa: F401 from .collective import P2POp # noqa: F401
from .collective import reduce_scatter # noqa: F401 from .collective import reduce_scatter # noqa: F401
from .communication import * # noqa: F401 from .communication import stream # noqa: F401
from .auto_parallel import shard_op # noqa: F401 from .auto_parallel import shard_op # noqa: F401
from .auto_parallel import shard_tensor # noqa: F401 from .auto_parallel import shard_tensor # noqa: F401
...@@ -66,7 +66,8 @@ from paddle.fluid.dygraph.parallel import ParallelEnv # noqa: F401 ...@@ -66,7 +66,8 @@ from paddle.fluid.dygraph.parallel import ParallelEnv # noqa: F401
from . import cloud_utils # noqa: F401 from . import cloud_utils # noqa: F401
from .sharding import * # noqa: F401 from .sharding import group_sharded_parallel # noqa: F401
from .sharding import save_group_sharded_model # noqa: F401
from . import rpc from . import rpc
......
...@@ -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.
from ..meta_optimizers import * # noqa: F401 from ..meta_optimizers import * # noqa: F401, F403
__all__ = [] __all__ = []
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
# limitations under the License. # limitations under the License.
import tempfile import tempfile
import os
import shutil
import paddle
from paddle.distributed.fleet.launch_utils import * from paddle.distributed.fleet.launch_utils import logger, pull_worker_log, start_local_trainers
from paddle.distributed.fleet.elastic.manager import LauncherInterface from paddle.distributed.fleet.elastic.manager import LauncherInterface
......
...@@ -65,9 +65,11 @@ import pathlib ...@@ -65,9 +65,11 @@ import pathlib
from argparse import ArgumentParser, REMAINDER from argparse import ArgumentParser, REMAINDER
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.distributed.fleet import launch_utils from paddle.distributed.fleet import launch_utils
from paddle.distributed.fleet.launch_utils import (
# TODO(danleifeng): Don't import * from a module get_host_name_ip, find_free_ports, logger, get_cluster, DeviceMode,
from paddle.distributed.fleet.launch_utils import * start_local_trainers, direct_start, watch_local_trainers,
terminate_local_procs, DistributeMode, ParameterServerLauncher, get_logger,
check_backend, block_windows_and_macos)
from paddle.distributed.fleet import cloud_utils from paddle.distributed.fleet import cloud_utils
from paddle.distributed.fleet import ascend_utils from paddle.distributed.fleet import ascend_utils
......
...@@ -19,7 +19,7 @@ import subprocess ...@@ -19,7 +19,7 @@ import subprocess
import re import re
import os import os
import platform import platform
from paddle.distributed.ps.utils.public import * from paddle.distributed.ps.utils.public import TrainerRuntimeConfig, build_var_distributed, dtype_to_size, get_dist_env, get_var_mem_size, logger
from paddle.distributed.passes import PassContext from paddle.distributed.passes import PassContext
from paddle.distributed.ps.utils.ps_factory import PsProgramBuilderFactory from paddle.distributed.ps.utils.ps_factory import PsProgramBuilderFactory
......
...@@ -13,19 +13,18 @@ ...@@ -13,19 +13,18 @@
# limitations under the License. # limitations under the License.
from .pass_base import new_pass, PassManager, PassContext from .pass_base import new_pass, PassManager, PassContext
from .fuse_all_reduce import * from .fuse_all_reduce import * # noqa: F403
from .auto_parallel_gradient_merge import * from .auto_parallel_gradient_merge import * # noqa: F403
from .auto_parallel_sharding import * from .auto_parallel_sharding import * # noqa: F403
from .auto_parallel_amp import * from .auto_parallel_amp import * # noqa: F403
from .auto_parallel_fp16 import * from .auto_parallel_fp16 import * # noqa: F403
from .auto_parallel_recompute import * from .auto_parallel_recompute import * # noqa: F403
from .auto_parallel_quantization import * from .auto_parallel_quantization import * # noqa: F403
from .auto_parallel_data_parallel_optimization import * from .auto_parallel_data_parallel_optimization import * # noqa: F403
from .auto_parallel_grad_clip import * from .auto_parallel_grad_clip import * # noqa: F403
from .cpp_pass import * from .cpp_pass import * # noqa: F403
import os from .ps_trainer_pass import * # noqa: F403
from .ps_trainer_pass import * from .ps_server_pass import * # noqa: F403
from .ps_server_pass import *
__all__ = [ __all__ = [
'new_pass', 'new_pass',
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
# 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.
from ..ps.utils.public import * import logging
import paddle.fluid as fluid
from ..ps.utils.public import get_optimize_ops, get_ps_endpoint, get_role_id, get_trainers
from .pass_base import PassBase, register_pass from .pass_base import PassBase, register_pass
from paddle.optimizer.lr import LRScheduler from paddle.optimizer.lr import LRScheduler
from paddle.optimizer.lr import ExponentialDecay, InverseTimeDecay, NaturalExpDecay, NoamDecay from paddle.optimizer.lr import ExponentialDecay, InverseTimeDecay, NaturalExpDecay, NoamDecay
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import os import os
import paddle import paddle
from ..ps.utils.public import * from ..ps.utils.public import * # noqa: F403
from paddle.framework import core from paddle.framework import core
from paddle.distributed.passes.pass_base import PassBase, register_pass from paddle.distributed.passes.pass_base import PassBase, register_pass
from paddle.fluid.transpiler.details.program_utils import delete_ops from paddle.fluid.transpiler.details.program_utils import delete_ops
......
...@@ -18,7 +18,7 @@ import os ...@@ -18,7 +18,7 @@ import os
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.distributed import fleet from paddle.distributed import fleet
from paddle.fluid import core from paddle.fluid import core
from paddle.distributed.ps.utils.public import * from paddle.distributed.ps.utils.public import * # noqa: F403
from paddle.fluid.framework import Program from paddle.fluid.framework import Program
from paddle.fluid.compiler import CompiledProgram from paddle.fluid.compiler import CompiledProgram
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
# 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.
from .ps_program_builder import * from .ps_program_builder import * # noqa: F403
from .public import * from .public import * # noqa: F403
__all__ = [ __all__ = [
'PsProgramBuilder', 'GeoPsProgramBuilder', 'CpuSyncPsProgramBuilder', 'PsProgramBuilder', 'GeoPsProgramBuilder', 'CpuSyncPsProgramBuilder',
......
...@@ -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.
from .public import * from .public import * # noqa: F403
from paddle.distributed.fleet.base.private_helper_function import wait_server_ready from paddle.distributed.fleet.base.private_helper_function import wait_server_ready
from paddle.distributed.passes import new_pass from paddle.distributed.passes import new_pass
......
...@@ -22,7 +22,7 @@ import paddle.fluid as fluid ...@@ -22,7 +22,7 @@ import paddle.fluid as fluid
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.fluid.contrib.decoder.beam_search_decoder import * from paddle.fluid.contrib.decoder.beam_search_decoder import BeamSearchDecoder, InitState, StateCell, TrainingDecoder
import unittest import unittest
paddle.enable_static() paddle.enable_static()
......
...@@ -25,7 +25,7 @@ import paddle.fluid as fluid ...@@ -25,7 +25,7 @@ import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
from dist_test_utils import * from dist_test_utils import remove_ps_flag
from paddle.fluid.incubate.fleet.parameter_server.mode import DistributedMode from paddle.fluid.incubate.fleet.parameter_server.mode import DistributedMode
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle.distribution import * from paddle.distribution import Categorical, Normal, Uniform
from paddle.fluid import layers from paddle.fluid import layers
import config import config
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle.distribution import * from paddle.distribution import Categorical, Distribution, Normal, Uniform
from paddle.fluid import layers from paddle.fluid import layers
from test_distribution import DistributionNumpy from test_distribution import DistributionNumpy
......
...@@ -19,7 +19,7 @@ import config ...@@ -19,7 +19,7 @@ import config
import numpy as np import numpy as np
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle.distribution import * from paddle.distribution import Normal
from paddle.fluid import layers from paddle.fluid import layers
from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand
import scipy.stats import scipy.stats
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle.distribution import * from paddle.distribution import Uniform
from paddle.fluid import layers from paddle.fluid import layers
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -21,7 +21,7 @@ from paddle.fluid.dygraph.dygraph_to_static.program_translator import ProgramTra ...@@ -21,7 +21,7 @@ from paddle.fluid.dygraph.dygraph_to_static.program_translator import ProgramTra
from paddle.fluid.dygraph.dygraph_to_static.utils import Dygraph2StaticException from paddle.fluid.dygraph.dygraph_to_static.utils import Dygraph2StaticException
import paddle.fluid.core as core import paddle.fluid.core as core
from ifelse_simple_func import * from ifelse_simple_func import NetWithControlFlowIf, add_fn, dyfunc_empty_nonlocal, dyfunc_ifelse_ret_int1, dyfunc_ifelse_ret_int2, dyfunc_ifelse_ret_int3, dyfunc_ifelse_ret_int4, dyfunc_with_if_else, dyfunc_with_if_else2, dyfunc_with_if_else3, dyfunc_with_if_else_with_list_geneator, fluid, if_tensor_case, if_with_and_or, if_with_and_or_1, if_with_and_or_2, if_with_and_or_3, if_with_and_or_4, if_with_class_var, loss_fn, nested_if_else, nested_if_else_2, nested_if_else_3
np.random.seed(1) np.random.seed(1)
......
...@@ -16,7 +16,7 @@ import sys ...@@ -16,7 +16,7 @@ import sys
import unittest import unittest
from paddle.fluid.dygraph.dygraph_to_static.ast_transformer import DygraphToStaticAst from paddle.fluid.dygraph.dygraph_to_static.ast_transformer import DygraphToStaticAst
from paddle.fluid.dygraph.dygraph_to_static.origin_info import * from paddle.fluid.dygraph.dygraph_to_static.origin_info import Location, ORIGI_INFO, OriginInfo, attach_origin_info, create_and_update_origin_info_map, gast, inspect, unwrap
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_func from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_func
from paddle.fluid.dygraph.jit import declarative from paddle.fluid.dygraph.jit import declarative
......
...@@ -22,7 +22,7 @@ import paddle ...@@ -22,7 +22,7 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.dygraph import declarative, ProgramTranslator, to_variable from paddle.fluid.dygraph import declarative, ProgramTranslator, to_variable
from paddle.fluid.dygraph.nn import Conv2D, BatchNorm, Linear, Pool2D from paddle.fluid.dygraph.nn import Conv2D, BatchNorm, Linear, Pool2D
from tsm_config_utils import * from tsm_config_utils import merge_configs, parse_config, print_configs
random.seed(0) random.seed(0)
np.random.seed(0) np.random.seed(0)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
from paddle.distributed.ps.utils.ps_program_builder import * from paddle.distributed.ps.utils.ps_program_builder import debug_program, logger, new_pass, ps_log_root_dir
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
import argparse import argparse
import sys import sys
......
...@@ -35,7 +35,6 @@ class FlPsTest(unittest.TestCase): ...@@ -35,7 +35,6 @@ class FlPsTest(unittest.TestCase):
prepare_python_path_and_return_module(__file__) prepare_python_path_and_return_module(__file__)
exitcode = os.system(' '.join(cmd)) exitcode = os.system(' '.join(cmd))
''' '''
pass
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
from paddle.fluid.tests.unittests.distributed_passes.ps_pass_test_base import * from paddle.fluid.tests.unittests.distributed_passes.ps_pass_test_base import PsPassTestBase, remove_path_if_exists
from paddle.distributed.ps.utils.public import logger, ps_log_root_dir from paddle.distributed.ps.utils.public import logger, ps_log_root_dir
import paddle.distributed.fleet.proto.the_one_ps_pb2 as ps_pb2 # noqa: F401 import paddle.distributed.fleet.proto.the_one_ps_pb2 as ps_pb2 # noqa: F401
from google.protobuf import text_format # noqa: F401 from google.protobuf import text_format # noqa: F401
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import paddle import paddle
import paddle.vision.transforms as transforms import paddle.vision.transforms as transforms
from paddle.io import * from paddle.io import Dataset
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -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.
from paddle.fluid.default_scope_funcs import * from paddle.fluid.default_scope_funcs import enter_local_scope, find_var, get_cur_scope, leave_local_scope, scoped_function, var
import unittest import unittest
......
...@@ -26,7 +26,7 @@ from paddle.fluid.layers.io import ListenAndServ ...@@ -26,7 +26,7 @@ from paddle.fluid.layers.io import ListenAndServ
from paddle.fluid.layers.io import Recv from paddle.fluid.layers.io import Recv
from paddle.fluid.layers.io import Send from paddle.fluid.layers.io import Send
import paddle.fluid.layers.ops as ops import paddle.fluid.layers.ops as ops
from dist_test_utils import * from dist_test_utils import remove_ps_flag
from paddle.fluid import core from paddle.fluid import core
......
...@@ -16,7 +16,7 @@ import numpy as np ...@@ -16,7 +16,7 @@ import numpy as np
import unittest import unittest
from paddle import fluid from paddle import fluid
from paddle.fluid import layers from paddle.fluid import layers
from paddle.fluid.layers.distributions import * from paddle.fluid.layers.distributions import Categorical, MultivariateNormalDiag, Normal, Uniform
import math import math
......
...@@ -18,7 +18,7 @@ import collections ...@@ -18,7 +18,7 @@ import collections
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
from decorator_helper import * from decorator_helper import prog_scope
class Memory(object): class Memory(object):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
from paddle.fluid.dygraph.nn import * from paddle.fluid.dygraph.nn import BatchNorm, Conv2D, Conv3D, Embedding, GroupNorm, LayerNorm, Linear, NCE, PRelu
import numpy as np import numpy as np
import os import os
import tempfile import tempfile
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import numpy as np import numpy as np
from paddle import LazyGuard from paddle import LazyGuard
from paddle.nn import Linear, Layer from paddle.nn import Linear, Layer
from paddle.nn.initializer import * from paddle.nn.initializer import Constant, Normal, TruncatedNormal, Uniform, XavierNormal, XavierUniform
from paddle.fluid import unique_name from paddle.fluid import unique_name
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
# 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.
from dist_test_utils import * import os
from dist_test_utils import remove_ps_flag, silentremove
silentremove("test_handle_signal_in_serv_op.flag") silentremove("test_handle_signal_in_serv_op.flag")
silentremove("test_list_and_serv_run_empty_optimize_block.flag") silentremove("test_list_and_serv_run_empty_optimize_block.flag")
......
...@@ -17,7 +17,7 @@ import re ...@@ -17,7 +17,7 @@ import re
from paddle.fluid.core import TracerEventType, TracerMemEventType from paddle.fluid.core import TracerEventType, TracerMemEventType
from .statistic_helper import * from .statistic_helper import intersection_ranges, merge_ranges, merge_self_ranges, sum_ranges
_AllTracerEventType = [ _AllTracerEventType = [
TracerEventType.Operator, TracerEventType.Dataloader, TracerEventType.Operator, TracerEventType.Dataloader,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册