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

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

上级 de6e7431
......@@ -14,7 +14,7 @@
try:
from paddle.version import full_version as __version__
from paddle.version import commit as __git_commit__
from paddle.cuda_env import *
from paddle.cuda_env import * # noqa: F403
except ImportError:
import sys
sys.stderr.write('''Warning with import paddle: you should not
......@@ -35,7 +35,7 @@ from .framework import set_flags # noqa: F401
from .framework import disable_static # noqa: F401
from .framework import enable_static # 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 .framework.dtype import iinfo # noqa: F401
......
......@@ -51,7 +51,7 @@ from .collective import batch_isend_irecv # noqa: F401
from .collective import P2POp # 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_tensor # noqa: F401
......@@ -66,7 +66,8 @@ from paddle.fluid.dygraph.parallel import ParallelEnv # 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
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ..meta_optimizers import * # noqa: F401
from ..meta_optimizers import * # noqa: F401, F403
__all__ = []
......
......@@ -13,9 +13,11 @@
# limitations under the License.
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
......
......@@ -65,9 +65,11 @@ import pathlib
from argparse import ArgumentParser, REMAINDER
import paddle.fluid as fluid
from paddle.distributed.fleet import launch_utils
# TODO(danleifeng): Don't import * from a module
from paddle.distributed.fleet.launch_utils import *
from paddle.distributed.fleet.launch_utils import (
get_host_name_ip, find_free_ports, logger, get_cluster, DeviceMode,
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 ascend_utils
......
......@@ -19,7 +19,7 @@ import subprocess
import re
import os
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.ps.utils.ps_factory import PsProgramBuilderFactory
......
......@@ -13,19 +13,18 @@
# limitations under the License.
from .pass_base import new_pass, PassManager, PassContext
from .fuse_all_reduce import *
from .auto_parallel_gradient_merge import *
from .auto_parallel_sharding import *
from .auto_parallel_amp import *
from .auto_parallel_fp16 import *
from .auto_parallel_recompute import *
from .auto_parallel_quantization import *
from .auto_parallel_data_parallel_optimization import *
from .auto_parallel_grad_clip import *
from .cpp_pass import *
import os
from .ps_trainer_pass import *
from .ps_server_pass import *
from .fuse_all_reduce import * # noqa: F403
from .auto_parallel_gradient_merge import * # noqa: F403
from .auto_parallel_sharding import * # noqa: F403
from .auto_parallel_amp import * # noqa: F403
from .auto_parallel_fp16 import * # noqa: F403
from .auto_parallel_recompute import * # noqa: F403
from .auto_parallel_quantization import * # noqa: F403
from .auto_parallel_data_parallel_optimization import * # noqa: F403
from .auto_parallel_grad_clip import * # noqa: F403
from .cpp_pass import * # noqa: F403
from .ps_trainer_pass import * # noqa: F403
from .ps_server_pass import * # noqa: F403
__all__ = [
'new_pass',
......
......@@ -12,7 +12,10 @@
# See the License for the specific language governing permissions and
# 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 paddle.optimizer.lr import LRScheduler
from paddle.optimizer.lr import ExponentialDecay, InverseTimeDecay, NaturalExpDecay, NoamDecay
......
......@@ -14,7 +14,7 @@
import os
import paddle
from ..ps.utils.public import *
from ..ps.utils.public import * # noqa: F403
from paddle.framework import core
from paddle.distributed.passes.pass_base import PassBase, register_pass
from paddle.fluid.transpiler.details.program_utils import delete_ops
......
......@@ -18,7 +18,7 @@ import os
import paddle.fluid as fluid
from paddle.distributed import fleet
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.compiler import CompiledProgram
from paddle.fluid.executor import Executor
......
......@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .ps_program_builder import *
from .public import *
from .ps_program_builder import * # noqa: F403
from .public import * # noqa: F403
__all__ = [
'PsProgramBuilder', 'GeoPsProgramBuilder', 'CpuSyncPsProgramBuilder',
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# 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.passes import new_pass
......
......@@ -22,7 +22,7 @@ import paddle.fluid as fluid
import paddle.fluid.framework as framework
import paddle.fluid.layers as layers
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
paddle.enable_static()
......
......@@ -25,7 +25,7 @@ import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.op import Operator
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
......
......@@ -16,7 +16,7 @@ import unittest
import numpy as np
import paddle
from paddle.distribution import *
from paddle.distribution import Categorical, Normal, Uniform
from paddle.fluid import layers
import config
......
......@@ -17,7 +17,7 @@ import unittest
import numpy as np
import paddle
from paddle import fluid
from paddle.distribution import *
from paddle.distribution import Categorical, Distribution, Normal, Uniform
from paddle.fluid import layers
from test_distribution import DistributionNumpy
......
......@@ -19,7 +19,7 @@ import config
import numpy as np
import paddle
from paddle import fluid
from paddle.distribution import *
from paddle.distribution import Normal
from paddle.fluid import layers
from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand
import scipy.stats
......
......@@ -17,7 +17,7 @@ import unittest
import numpy as np
import paddle
from paddle import fluid
from paddle.distribution import *
from paddle.distribution import Uniform
from paddle.fluid import layers
from paddle.fluid.framework import _test_eager_guard
......
......@@ -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
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)
......
......@@ -16,7 +16,7 @@ import sys
import unittest
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.jit import declarative
......
......@@ -22,7 +22,7 @@ import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph import declarative, ProgramTranslator, to_variable
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)
np.random.seed(0)
......
......@@ -13,7 +13,7 @@
# limitations under the License.
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 argparse
import sys
......
......@@ -35,7 +35,6 @@ class FlPsTest(unittest.TestCase):
prepare_python_path_and_return_module(__file__)
exitcode = os.system(' '.join(cmd))
'''
pass
if __name__ == '__main__':
......
......@@ -14,7 +14,7 @@
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
import paddle.distributed.fleet.proto.the_one_ps_pb2 as ps_pb2 # noqa: F401
from google.protobuf import text_format # noqa: F401
......
......@@ -17,7 +17,7 @@ import unittest
import paddle
import paddle.vision.transforms as transforms
from paddle.io import *
from paddle.io import Dataset
from paddle.fluid.framework import _test_eager_guard
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# 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
......
......@@ -26,7 +26,7 @@ from paddle.fluid.layers.io import ListenAndServ
from paddle.fluid.layers.io import Recv
from paddle.fluid.layers.io import Send
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
......
......@@ -16,7 +16,7 @@ import numpy as np
import unittest
from paddle import fluid
from paddle.fluid import layers
from paddle.fluid.layers.distributions import *
from paddle.fluid.layers.distributions import Categorical, MultivariateNormalDiag, Normal, Uniform
import math
......
......@@ -18,7 +18,7 @@ import collections
import paddle
import paddle.fluid as fluid
import unittest
from decorator_helper import *
from decorator_helper import prog_scope
class Memory(object):
......
......@@ -15,7 +15,7 @@
import unittest
import paddle.fluid as fluid
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 os
import tempfile
......
......@@ -17,7 +17,7 @@ import unittest
import numpy as np
from paddle import LazyGuard
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
......
......@@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# 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_list_and_serv_run_empty_optimize_block.flag")
......
......@@ -17,7 +17,7 @@ import re
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 = [
TracerEventType.Operator, TracerEventType.Dataloader,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册