diff --git a/python/paddle/__init__.py b/python/paddle/__init__.py index 2cfcde0532a229fa118f135c79d1d8ab02619d33..7312a0d9f807a0e92c3e19f474372f5e543b030e 100755 --- a/python/paddle/__init__.py +++ b/python/paddle/__init__.py @@ -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 diff --git a/python/paddle/distributed/__init__.py b/python/paddle/distributed/__init__.py index 6cad46784635ff76f04e2598305775802da3e6d1..13c305b58da7342fee55c9cd2f7858322761d9e9 100644 --- a/python/paddle/distributed/__init__.py +++ b/python/paddle/distributed/__init__.py @@ -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 diff --git a/python/paddle/distributed/fleet/base/meta_optimizer_factory.py b/python/paddle/distributed/fleet/base/meta_optimizer_factory.py index 825ccd7889b4eb01d5b7d072ccc3f766d6614a6b..c2e55cfc38d63f65ba42e7d9ec375b0aff40d426 100755 --- a/python/paddle/distributed/fleet/base/meta_optimizer_factory.py +++ b/python/paddle/distributed/fleet/base/meta_optimizer_factory.py @@ -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__ = [] diff --git a/python/paddle/distributed/fleet/elastic/collective.py b/python/paddle/distributed/fleet/elastic/collective.py index b2920d412b6196507516b77db5cfd060a83782ed..aa5c962b99467e89832831171851f5b63a972fcc 100644 --- a/python/paddle/distributed/fleet/elastic/collective.py +++ b/python/paddle/distributed/fleet/elastic/collective.py @@ -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 diff --git a/python/paddle/distributed/fleet/launch.py b/python/paddle/distributed/fleet/launch.py index 98919fe241445da237523310d114016c22a42648..5fcc0e6a33b2f6cfce31d24f2478e77ef5050512 100755 --- a/python/paddle/distributed/fleet/launch.py +++ b/python/paddle/distributed/fleet/launch.py @@ -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 diff --git a/python/paddle/distributed/fleet/meta_optimizers/ps_optimizer.py b/python/paddle/distributed/fleet/meta_optimizers/ps_optimizer.py index c1c40f7213a8b6f2d2ea45af3102baa785fe893b..523a6741102937a7de11b89b6b6e827e022f7a16 100755 --- a/python/paddle/distributed/fleet/meta_optimizers/ps_optimizer.py +++ b/python/paddle/distributed/fleet/meta_optimizers/ps_optimizer.py @@ -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 diff --git a/python/paddle/distributed/passes/__init__.py b/python/paddle/distributed/passes/__init__.py index 5f721a1df50df6711f547854f0b6a6789d9df33f..056540a4a1571fe082b1f65770af7832c7ad48f6 100644 --- a/python/paddle/distributed/passes/__init__.py +++ b/python/paddle/distributed/passes/__init__.py @@ -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', diff --git a/python/paddle/distributed/passes/ps_server_pass.py b/python/paddle/distributed/passes/ps_server_pass.py index 64c7f7fb9128dda72e140f25d6526cf2e77c5d75..27c10fd1f5bf758d1bfab4d286b23aac629bdeb9 100755 --- a/python/paddle/distributed/passes/ps_server_pass.py +++ b/python/paddle/distributed/passes/ps_server_pass.py @@ -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 diff --git a/python/paddle/distributed/passes/ps_trainer_pass.py b/python/paddle/distributed/passes/ps_trainer_pass.py index 95f4e980cf46b75b8e2a902f5d7bddc6639c9aaa..1b5eb1e442ff12a6eb9d6011d6eca3c3a0891115 100755 --- a/python/paddle/distributed/passes/ps_trainer_pass.py +++ b/python/paddle/distributed/passes/ps_trainer_pass.py @@ -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 diff --git a/python/paddle/distributed/ps/the_one_ps.py b/python/paddle/distributed/ps/the_one_ps.py index 965468d737383e960a28f864cc208930c3f1dd40..78ecef22b63e6160651d9417de4a19cd3bd03e4f 100755 --- a/python/paddle/distributed/ps/the_one_ps.py +++ b/python/paddle/distributed/ps/the_one_ps.py @@ -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 diff --git a/python/paddle/distributed/ps/utils/ps_factory.py b/python/paddle/distributed/ps/utils/ps_factory.py index 2fc1a06ad9693ffb7688b18cbc658f0f86dc90c9..1f522ec27f82cf56aa9716f6a64e4fbfb4dda38d 100755 --- a/python/paddle/distributed/ps/utils/ps_factory.py +++ b/python/paddle/distributed/ps/utils/ps_factory.py @@ -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', diff --git a/python/paddle/distributed/ps/utils/ps_program_builder.py b/python/paddle/distributed/ps/utils/ps_program_builder.py index 2a8d273d9923fabce2aa365fe1025f5f2ea37d93..f38ca4f016d1203cf490f9529cd8f47c03ec3eb9 100755 --- a/python/paddle/distributed/ps/utils/ps_program_builder.py +++ b/python/paddle/distributed/ps/utils/ps_program_builder.py @@ -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 diff --git a/python/paddle/fluid/tests/test_beam_search_decoder.py b/python/paddle/fluid/tests/test_beam_search_decoder.py index 7458bf4c57c21fb4e71b8f43699c078755a6cc10..66cd8e89d3237ba1572362af99b06e8c8794c450 100644 --- a/python/paddle/fluid/tests/test_beam_search_decoder.py +++ b/python/paddle/fluid/tests/test_beam_search_decoder.py @@ -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() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py index 2da9079467f83cc15285566f01c9683bd4258697..927b02d74eb3ef4c6409af27b2db3fbf7a5db882 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution.py index 4d951a609608ad5864984f28a3248ad21f63eef0..30024c10fee38fdf06497d0fe59cd418be878f51 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py index 7be3bcb55751c8d6442368f51f5457f614a05723..4be500b6084dbb744d29bdfe5dc15f263640de66 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_normal.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_normal.py index 1873ac7efa6b56aaeb49b3ff5afb2bf3d120a54a..d90405599554d5cc34e6b2523c15a7e7bdd3e9a4 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_normal.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_normal.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py index 7b6a3a2a3bd02abf8123f8ff19c040be1fdadd84..6aafa9cb356ce4f723e7d673537386019a30cfbc 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ifelse.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ifelse.py index 6870e8c08da4e936b1433846c1f382a67660e5e8..d40c37f3fd666f329944cc52b224e401d867ad58 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ifelse.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ifelse.py @@ -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) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py index 07260c9c0b868bac417e29807d4ba094454b33e6..744cc40cdfb583b0517750dc1b34b681a68cf9e9 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py index 6da285c01b3ecbd9d01ad997600c3d1d04ac4a55..7561e7aa13798acb6cbb2977f363a0c75d0adb33 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py @@ -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) diff --git a/python/paddle/fluid/tests/unittests/ps/ps_dnn_trainer.py b/python/paddle/fluid/tests/unittests/ps/ps_dnn_trainer.py index d54f86b38633828abeb6a3df55c245335781c0ca..d40d4f07719f00df4239f4c724e880b1a16c0ef9 100755 --- a/python/paddle/fluid/tests/unittests/ps/ps_dnn_trainer.py +++ b/python/paddle/fluid/tests/unittests/ps/ps_dnn_trainer.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/ps/test_fl_ps.py b/python/paddle/fluid/tests/unittests/ps/test_fl_ps.py index 0a993217ebad2fdf5adc5365b9ec553cac38b520..2726d7c10cdbe19984a84b73a1bd0d558cf7d5b6 100755 --- a/python/paddle/fluid/tests/unittests/ps/test_fl_ps.py +++ b/python/paddle/fluid/tests/unittests/ps/test_fl_ps.py @@ -35,7 +35,6 @@ class FlPsTest(unittest.TestCase): prepare_python_path_and_return_module(__file__) exitcode = os.system(' '.join(cmd)) ''' - pass if __name__ == '__main__': diff --git a/python/paddle/fluid/tests/unittests/ps/test_the_one_ps.py b/python/paddle/fluid/tests/unittests/ps/test_the_one_ps.py index c0d10d63687f4749ac8e9e0d33f43306a408d722..b561d82fc5f30c647e627abbdb870ff09a435907 100755 --- a/python/paddle/fluid/tests/unittests/ps/test_the_one_ps.py +++ b/python/paddle/fluid/tests/unittests/ps/test_the_one_ps.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_dataloader_dataset.py b/python/paddle/fluid/tests/unittests/test_dataloader_dataset.py index 9734bfef3f0b164dce5c808c09e3c8844a7f056c..6b3ab060c3dbd82b6215464bbf92ba54293c30c4 100644 --- a/python/paddle/fluid/tests/unittests/test_dataloader_dataset.py +++ b/python/paddle/fluid/tests/unittests/test_dataloader_dataset.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_default_scope_funcs.py b/python/paddle/fluid/tests/unittests/test_default_scope_funcs.py index 03e49216559535081eb842d8190ad28a01bfc5cd..beae3124ced823ecfd98a813e6af639168057203 100644 --- a/python/paddle/fluid/tests/unittests/test_default_scope_funcs.py +++ b/python/paddle/fluid/tests/unittests/test_default_scope_funcs.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_dist_train.py b/python/paddle/fluid/tests/unittests/test_dist_train.py index e32908aea8fbc8c915135ed90dfc608a49d69600..7299854241907972a6cc97dad725554facb68796 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_train.py +++ b/python/paddle/fluid/tests/unittests/test_dist_train.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_distributions.py b/python/paddle/fluid/tests/unittests/test_distributions.py index daf2adacb41688571efadd7db2b6b9d61ce59933..d79e8784e2b22037fe109ac9e751ad6b59121842 100644 --- a/python/paddle/fluid/tests/unittests/test_distributions.py +++ b/python/paddle/fluid/tests/unittests/test_distributions.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_dynrnn_gradient_check.py b/python/paddle/fluid/tests/unittests/test_dynrnn_gradient_check.py index a629158cb9367d5ba481061026c46665afa6848b..7b7921d91c22acb99a3f95ae501f020a24f7e609 100644 --- a/python/paddle/fluid/tests/unittests/test_dynrnn_gradient_check.py +++ b/python/paddle/fluid/tests/unittests/test_dynrnn_gradient_check.py @@ -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): diff --git a/python/paddle/fluid/tests/unittests/test_imperative_load_static_param.py b/python/paddle/fluid/tests/unittests/test_imperative_load_static_param.py index a1c9708923435186b7182483187cefe0b2712713..e61671e39f1698cf8e6db760238d123212cbec09 100644 --- a/python/paddle/fluid/tests/unittests/test_imperative_load_static_param.py +++ b/python/paddle/fluid/tests/unittests/test_imperative_load_static_param.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_lazy_init.py b/python/paddle/fluid/tests/unittests/test_lazy_init.py index 07a290234da877479c5f4b70ca6d16cb10a59d98..79b3429b10e0bf78852b84462a0db59b55fa476f 100644 --- a/python/paddle/fluid/tests/unittests/test_lazy_init.py +++ b/python/paddle/fluid/tests/unittests/test_lazy_init.py @@ -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 diff --git a/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py b/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py index 62e063179fa4c840ddb6c361ae654561c59a67ac..897689d55971428d2793c05b8af4fb393c014a04 100644 --- a/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py +++ b/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py @@ -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") diff --git a/python/paddle/profiler/profiler_statistic.py b/python/paddle/profiler/profiler_statistic.py index d4788c58fe144e1e46cee283c1c246e416dadff1..c0dc7fea44379775e7dbe27f6a9546d151f1e8bb 100755 --- a/python/paddle/profiler/profiler_statistic.py +++ b/python/paddle/profiler/profiler_statistic.py @@ -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,