From 632ea5759ac61232747203904e992dc1fe9cdec1 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 12 Oct 2022 10:34:41 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused imports in unittests/auto_parallel,distribution (#46915) --- .../unittests/auto_parallel/amp_pass_unittest.py | 3 +-- .../auto_parallel/auto_parallel_relaunch_model.py | 9 --------- .../auto_parallel_relaunch_with_gpt_planner.py | 4 ---- .../auto_parallel/clip_grad_by_global_norm.py | 3 +-- .../tests/unittests/auto_parallel/converter.py | 1 - .../tests/unittests/auto_parallel/engine_api.py | 13 +------------ .../tests/unittests/auto_parallel/engine_api_dp.py | 10 +--------- .../auto_parallel/gradient_merge_pass_unittest.py | 3 +-- .../unittests/auto_parallel/high_order_grad.py | 2 -- .../unittests/auto_parallel/iterable_dataset.py | 12 ------------ .../auto_parallel/optimization_tuner_api.py | 12 ------------ .../auto_parallel/recompute_pass_unittest.py | 3 +-- .../auto_parallel/sharding_pass_unittest.py | 3 +-- .../auto_parallel/test_auto_parallel_relaunch.py | 2 -- .../tests/unittests/auto_parallel/test_base_cost.py | 4 ---- .../tests/unittests/auto_parallel/test_cluster.py | 1 - .../tests/unittests/auto_parallel/test_comp_cost.py | 2 -- .../tests/unittests/auto_parallel/test_converter.py | 2 -- .../unittests/auto_parallel/test_dist_attr_v2.py | 2 -- .../unittests/auto_parallel/test_dist_context.py | 4 ---- .../unittests/auto_parallel/test_dist_embedding.py | 3 --- .../unittests/auto_parallel/test_dist_matmul.py | 1 - .../unittests/auto_parallel/test_dist_op_cost.py | 1 - .../unittests/auto_parallel/test_dist_pnorm.py | 1 - .../unittests/auto_parallel/test_dist_reshape.py | 4 ---- .../unittests/auto_parallel/test_dist_slice.py | 1 - .../unittests/auto_parallel/test_dist_split.py | 3 --- .../unittests/auto_parallel/test_engine_api.py | 2 -- .../unittests/auto_parallel/test_engine_api_dp.py | 2 -- .../unittests/auto_parallel/test_high_order_grad.py | 2 -- .../tests/unittests/auto_parallel/test_interface.py | 3 --- .../auto_parallel/test_iterable_dataset.py | 2 -- .../unittests/auto_parallel/test_lr_grad_clip.py | 10 ---------- .../unittests/auto_parallel/test_new_cost_model.py | 2 +- .../auto_parallel/test_optimization_tuner_api.py | 1 - .../tests/unittests/auto_parallel/test_pass_amp.py | 2 -- .../unittests/auto_parallel/test_pass_grad_clip.py | 2 -- .../auto_parallel/test_pass_gradient_merge.py | 2 -- .../auto_parallel/test_pass_quantization.py | 5 +---- .../unittests/auto_parallel/test_pass_recompute.py | 2 -- .../unittests/auto_parallel/test_pass_sharding.py | 2 -- .../unittests/auto_parallel/test_prim_dist_op.py | 6 ++---- .../unittests/auto_parallel/test_process_mesh.py | 3 --- .../auto_parallel/test_relaunch_with_gpt_planner.py | 2 -- .../auto_parallel/test_relaunch_with_planner.py | 2 -- .../tests/unittests/auto_parallel/test_strategy.py | 1 - .../tests/unittests/auto_parallel/test_to_static.py | 2 -- .../auto_parallel/test_while_op_completion.py | 8 +------- .../auto_parallel/test_while_op_partition.py | 6 +----- .../unittests/distribution/test_dirichlet_op.py | 7 ------- .../unittests/distribution/test_distribution.py | 2 -- .../distribution/test_distribution_beta.py | 1 - .../distribution/test_distribution_beta_static.py | 1 - .../distribution/test_distribution_categorical.py | 1 - .../distribution/test_distribution_constraint.py | 1 - .../distribution/test_distribution_dirichlet.py | 1 - .../test_distribution_dirichlet_static.py | 2 +- .../distribution/test_distribution_expfamily.py | 1 - .../test_distribution_expfamily_static.py | 1 - .../distribution/test_distribution_independent.py | 2 -- .../test_distribution_independent_static.py | 2 -- .../distribution/test_distribution_transform.py | 2 +- .../test_distribution_transform_static.py | 2 +- .../test_distribution_transformed_distribution.py | 2 -- ..._distribution_transformed_distribution_static.py | 2 -- .../distribution/test_distribution_uniform.py | 1 - .../distribution/test_distribution_variable.py | 2 -- .../fluid/tests/unittests/distribution/test_kl.py | 1 - .../tests/unittests/distribution/test_kl_static.py | 1 - 69 files changed, 16 insertions(+), 197 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/amp_pass_unittest.py b/python/paddle/fluid/tests/unittests/auto_parallel/amp_pass_unittest.py index 1f4cf61dad5..60b47a364d8 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/amp_pass_unittest.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/amp_pass_unittest.py @@ -13,14 +13,13 @@ # limitations under the License. import unittest -import sys import random import numpy as np import paddle from paddle.distributed.fleet import auto from paddle.fluid.dygraph.parallel import ParallelEnv -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model def apply_pass(use_amp=False, level=None): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_model.py b/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_model.py index 197bc151636..bccf0963ce1 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_model.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_model.py @@ -12,21 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import time -import paddle.fluid as fluid -import copy -import os import numpy as np -import subprocess import paddle import paddle.nn as nn -import paddle.fluid as fluid import paddle.static as static import paddle.nn.functional as F import paddle.utils as utils -from paddle.fluid import layers -from paddle.io import IterableDataset, DataLoader from paddle.distributed import fleet from paddle.distributed.fleet import auto diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_with_gpt_planner.py b/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_with_gpt_planner.py index ee8c79ff9b1..3634f4258a0 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_with_gpt_planner.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/auto_parallel_relaunch_with_gpt_planner.py @@ -19,10 +19,6 @@ import sys import numpy as np -from paddle.distributed.fleet import auto -from auto_parallel_relaunch_model import mlp_pretrain_forward -from auto_parallel_relaunch_model import batch_generator_creator - sys.path.append("..") import auto_parallel_gpt_model as modeling from auto_parallel_gpt_model import GPTModel, GPTForPretraining, GPTPretrainingCriterion diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/clip_grad_by_global_norm.py b/python/paddle/fluid/tests/unittests/auto_parallel/clip_grad_by_global_norm.py index 1cbc8aed120..ba255fba279 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/clip_grad_by_global_norm.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/clip_grad_by_global_norm.py @@ -13,14 +13,13 @@ # limitations under the License. import unittest -import sys import random import numpy as np import paddle from paddle.distributed.fleet import auto from paddle.fluid.dygraph.parallel import ParallelEnv -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/converter.py b/python/paddle/fluid/tests/unittests/auto_parallel/converter.py index d5d7caa7b77..291dae6612c 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/converter.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/converter.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import numpy as np import paddle diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py b/python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py index 338aa9f36b4..2d477434d3a 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py @@ -12,26 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import time import tempfile -import copy import os import numpy as np -import subprocess import paddle import paddle.nn as nn -import paddle.fluid as fluid -import paddle.static as static import paddle.nn.functional as F -import paddle.utils as utils -from paddle.fluid import layers -from paddle.io import Dataset, IterableDataset, DataLoader +from paddle.io import Dataset from paddle.distributed.fleet import auto -from paddle.distributed.auto_parallel.interface import get_collection, CollectionNames -from paddle.optimizer.lr import CosineAnnealingDecay -from paddle.fluid.dataloader.collate import default_collate_fn paddle.enable_static() global_process_mesh = auto.ProcessMesh(mesh=[0, 1]) diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/engine_api_dp.py b/python/paddle/fluid/tests/unittests/auto_parallel/engine_api_dp.py index 17735594c5a..deb084a79fe 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/engine_api_dp.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/engine_api_dp.py @@ -12,21 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import time import tempfile -import copy import os import numpy as np -import subprocess import paddle import paddle.nn as nn -import paddle.fluid as fluid -import paddle.static as static import paddle.nn.functional as F -import paddle.utils as utils -from paddle.fluid import layers -from paddle.io import Dataset, DataLoader +from paddle.io import Dataset from paddle.distributed.fleet import auto diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/gradient_merge_pass_unittest.py b/python/paddle/fluid/tests/unittests/auto_parallel/gradient_merge_pass_unittest.py index 13382aad49b..f70829c9fb6 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/gradient_merge_pass_unittest.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/gradient_merge_pass_unittest.py @@ -13,14 +13,13 @@ # limitations under the License. import unittest -import sys import random import numpy as np import paddle from paddle.distributed.fleet import auto from paddle.fluid.dygraph.parallel import ParallelEnv -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/high_order_grad.py b/python/paddle/fluid/tests/unittests/auto_parallel/high_order_grad.py index d69b0cf342f..8e148719a56 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/high_order_grad.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/high_order_grad.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import random import paddle -import unittest import numpy as np from paddle.distributed.fleet import auto from paddle.incubate.autograd import Hessian diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/iterable_dataset.py b/python/paddle/fluid/tests/unittests/auto_parallel/iterable_dataset.py index e19023daa68..d5eb88bc6b5 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/iterable_dataset.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/iterable_dataset.py @@ -12,26 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import time import tempfile -import copy import os import numpy as np -import subprocess import paddle import paddle.nn as nn -import paddle.fluid as fluid -import paddle.static as static import paddle.nn.functional as F -import paddle.utils as utils -from paddle.fluid import layers -from paddle.io import Dataset, IterableDataset, DataLoader -from paddle.static import InputSpec from paddle.distributed.fleet import auto -from paddle.optimizer.lr import CosineAnnealingDecay -from paddle.fluid.dataloader.collate import default_collate_fn paddle.enable_static() global_process_mesh = auto.ProcessMesh(mesh=[0, 1]) diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/optimization_tuner_api.py b/python/paddle/fluid/tests/unittests/auto_parallel/optimization_tuner_api.py index 484c67f69c3..3cc24a538fe 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/optimization_tuner_api.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/optimization_tuner_api.py @@ -12,21 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import time -import tempfile -import copy -import os -import numpy as np -import subprocess import paddle import paddle.nn as nn -import paddle.fluid as fluid -import paddle.static as static import paddle.nn.functional as F -import paddle.utils as utils -from paddle.fluid import layers -from paddle.io import Dataset, IterableDataset, DataLoader from paddle.distributed.fleet import auto from engine_api_dp import MyDataset diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/recompute_pass_unittest.py b/python/paddle/fluid/tests/unittests/auto_parallel/recompute_pass_unittest.py index d2eeefcd84e..e0b9f9d9e75 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/recompute_pass_unittest.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/recompute_pass_unittest.py @@ -13,14 +13,13 @@ # limitations under the License. import unittest -import sys import random import numpy as np import paddle from paddle.distributed.fleet import auto from paddle.fluid.dygraph.parallel import ParallelEnv -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model def apply_pass(use_recompute=False): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/sharding_pass_unittest.py b/python/paddle/fluid/tests/unittests/auto_parallel/sharding_pass_unittest.py index 50b743c5b3a..78f37e37db1 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/sharding_pass_unittest.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/sharding_pass_unittest.py @@ -13,14 +13,13 @@ # limitations under the License. import unittest -import sys import random import numpy as np import paddle from paddle.distributed.fleet import auto from paddle.fluid.dygraph.parallel import ParallelEnv -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py index 781b5e6b712..53734e21d9a 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py @@ -17,9 +17,7 @@ import unittest import os import sys import json -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage cluster_json = """ { diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_base_cost.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_base_cost.py index bf81b2cab82..745351f3d7e 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_base_cost.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_base_cost.py @@ -27,11 +27,7 @@ from paddle.distributed.auto_parallel.completion import Completer from paddle.distributed.auto_parallel.dist_context import DistributedContext from paddle.distributed import fleet from paddle.distributed.auto_parallel.parallelizer import AutoParallelizer -from paddle.distributed.auto_parallel.partitioner import Partitioner -from paddle.distributed.auto_parallel.reshard import Resharder -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr from paddle.distributed.auto_parallel.cluster import Cluster -from paddle.distributed.auto_parallel.cost import CommContext from paddle.distributed.auto_parallel.cost.base_cost import build_comp_desc_from_dist_op from paddle.distributed.auto_parallel.cost.base_cost import build_comm_desc_from_dist_op from paddle.distributed.auto_parallel.cost.base_cost import build_comm_costs_from_descs diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_cluster.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_cluster.py index debff51a2ca..1aeed0c72ef 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_cluster.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_cluster.py @@ -17,7 +17,6 @@ import unittest import os import json -import paddle from paddle.distributed.auto_parallel.cluster import Cluster from paddle.distributed.auto_parallel.cluster import get_default_cluster diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py index c0f7c878192..f57b7d86311 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py @@ -16,7 +16,6 @@ import unittest import os import json -import paddle from paddle.distributed.auto_parallel.cluster import Cluster from paddle.distributed.auto_parallel.cost.comp_op_cost import AssignOpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import AssignValueOpCost @@ -51,7 +50,6 @@ from paddle.distributed.auto_parallel.cost.comp_op_cost import LogOpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import LookupTableV2OpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import LookupTableV2GradOpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import MatmulOpCost -from paddle.distributed.auto_parallel.cost.comp_op_cost import MatmulGradOpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import MatmulV2OpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import MatmulV2GradOpCost from paddle.distributed.auto_parallel.cost.comp_op_cost import MemcpyOpCost diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py index 40fc301f261..7c838513d79 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage from paddle.distributed.auto_parallel.converter import Converter diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_attr_v2.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_attr_v2.py index 75b73d06122..9977fb4654a 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_attr_v2.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_attr_v2.py @@ -14,8 +14,6 @@ import unittest import paddle -import numpy as np -import paddle.nn as nn import paddle.static as static from paddle.fluid.core import TensorDistAttr from paddle.fluid.core import OperatorDistAttr diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py index 63621256193..6caf9ba82c3 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py @@ -13,21 +13,17 @@ # limitations under the License. import unittest -import os -import json import copy import paddle import numpy as np import paddle.nn as nn -import paddle.utils as utils import paddle.static as static import paddle.nn.functional as F from paddle.distributed import fleet from paddle.distributed.fleet import auto from paddle.distributed.auto_parallel.dist_context import DistributedContext -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_embedding.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_embedding.py index 86eab79b587..034a2cf1892 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_embedding.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_embedding.py @@ -16,9 +16,6 @@ import unittest import paddle from paddle.distributed.fleet import auto -from paddle.fluid import program_guard -from paddle.fluid.backward import append_backward -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr from test_dist_pnorm import parallelizer paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_matmul.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_matmul.py index 6072a226f92..6ca0619800e 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_matmul.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_matmul.py @@ -18,7 +18,6 @@ from paddle.distributed.fleet import auto from paddle.fluid import program_guard from paddle.fluid.backward import append_backward -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_op_cost.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_op_cost.py index c31991243b6..d7bdbfd7774 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_op_cost.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_op_cost.py @@ -29,7 +29,6 @@ paddle.enable_static() def parallelizer(program_func, rank): from paddle.distributed.auto_parallel.completion import Completer - from paddle.distributed.auto_parallel.partitioner import Partitioner from paddle.distributed.auto_parallel.dist_context import DistributedContext main_program, startup_program, loss = program_func() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_pnorm.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_pnorm.py index 51424638897..9f54f2a774a 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_pnorm.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_pnorm.py @@ -18,7 +18,6 @@ from paddle.distributed.fleet import auto from paddle.fluid import program_guard from paddle.fluid.backward import append_backward -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_reshape.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_reshape.py index bc4918de2e5..02797d690f2 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_reshape.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_reshape.py @@ -16,10 +16,6 @@ import unittest import paddle from paddle.distributed.fleet import auto -from paddle.fluid import program_guard -from paddle.fluid.backward import append_backward -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr - paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_slice.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_slice.py index 678828f949b..89261e6c9bf 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_slice.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_slice.py @@ -15,7 +15,6 @@ import unittest import paddle from paddle.distributed.fleet import auto -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_split.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_split.py index 566c57a140d..7d7c60f4bdd 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_split.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_dist_split.py @@ -16,9 +16,6 @@ import unittest import paddle from paddle.distributed.fleet import auto -from paddle.fluid import program_guard -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr - paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py index 3dfedea46f6..c8aba02719c 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestEngineAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py index 3e6105917a8..fab8db0182e 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestEngineAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py index 104cfb59ff5..7c3629182fa 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestHighOrderGrad(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_interface.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_interface.py index a570bd8e291..a36c142dc86 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_interface.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_interface.py @@ -14,15 +14,12 @@ import unittest import paddle -import paddle.fluid as fluid import paddle.nn as nn import paddle.nn.functional as F import paddle.static as static -import paddle.distributed as dist from paddle.distributed.fleet import auto from paddle.distributed.auto_parallel.dist_context import get_default_distributed_context from paddle.distributed.auto_parallel.process_mesh import ProcessMesh -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_iterable_dataset.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_iterable_dataset.py index 7e990d88fa9..8a7d9d57602 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_iterable_dataset.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_iterable_dataset.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestEngineAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_lr_grad_clip.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_lr_grad_clip.py index 9c116a32881..7077cf8acd6 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_lr_grad_clip.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_lr_grad_clip.py @@ -14,18 +14,8 @@ import unittest -import os -import numpy as np - import paddle -import paddle.nn as nn -import paddle.nn.functional as F from paddle.distributed.fleet import auto -import paddle.distributed.fleet as fleet - -from paddle.io import Dataset -from paddle.static import InputSpec -from paddle.fluid.framework import _non_static_mode from test_to_static import MLPLayer, MyDataset diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_new_cost_model.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_new_cost_model.py index e463adfc66d..59db55596af 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_new_cost_model.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_new_cost_model.py @@ -25,7 +25,7 @@ from paddle.distributed.auto_parallel.cost.base_cost import build_comp_desc_str_ from paddle.distributed.auto_parallel.cost.base_cost import calc_time_by_modeling from paddle.distributed.auto_parallel.cluster import Cluster from paddle.distributed.auto_parallel.cost import CommContext -from test_cluster import cluster_json, multi_cluster_json +from test_cluster import cluster_json paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_optimization_tuner_api.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_optimization_tuner_api.py index c88d0810f15..68f2376a834 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_optimization_tuner_api.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_optimization_tuner_api.py @@ -18,7 +18,6 @@ import os import sys import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestOptimizationTunerAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_amp.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_amp.py index ed2cf0328e8..09de1d18c1a 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_amp.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_amp.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestAMPPass(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_grad_clip.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_grad_clip.py index 3527589db62..bfc5eb18a06 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_grad_clip.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_grad_clip.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestGradientClip(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_gradient_merge.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_gradient_merge.py index e55ddbea583..7ce62fa1389 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_gradient_merge.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_gradient_merge.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestGradientMergePass(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_quantization.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_quantization.py index b1b888d2b0d..e8df938d622 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_quantization.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_quantization.py @@ -13,13 +13,10 @@ # limitations under the License. import unittest -import sys -import random -import numpy as np import paddle from paddle.distributed.fleet import auto -from get_gpt_model import generate_model, create_data_holder, FakeDataset +from get_gpt_model import FakeDataset, generate_model paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_recompute.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_recompute.py index e7eb7ddd2a6..c6062faa260 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_recompute.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_recompute.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestRecomputePass(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_sharding.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_sharding.py index 77e969c83bf..31467b6d505 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_sharding.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_pass_sharding.py @@ -16,9 +16,7 @@ import tempfile import unittest import os import sys -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestShardingPass(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_prim_dist_op.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_prim_dist_op.py index b3dcd97cd20..028d2b820a5 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_prim_dist_op.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_prim_dist_op.py @@ -16,15 +16,13 @@ import unittest import paddle from paddle.distributed.fleet import auto -from paddle.fluid import program_guard -from paddle.incubate.autograd import prim2orig, enable_prim, prim_enabled +from paddle.incubate.autograd import enable_prim from paddle.fluid.layer_helper import LayerHelper -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr from paddle.distributed.fleet import auto from paddle.distributed.auto_parallel.completion import Completer from paddle.distributed.auto_parallel.partitioner import Partitioner from paddle.distributed.auto_parallel.utils import set_var_dist_attr -from paddle.distributed.auto_parallel.dist_context import DistributedContext, get_default_distributed_context, set_default_distributed_context +from paddle.distributed.auto_parallel.dist_context import DistributedContext, get_default_distributed_context paddle.enable_static() enable_prim() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_process_mesh.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_process_mesh.py index ce38780564b..6b83c4da245 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_process_mesh.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_process_mesh.py @@ -15,14 +15,11 @@ import unittest import numpy as np import paddle -import paddle.fluid as fluid import paddle.nn as nn import paddle.nn.functional as F import paddle.static as static -from paddle.distributed.fleet import auto from paddle.distributed.auto_parallel.process_mesh import ProcessMesh from paddle.distributed.auto_parallel.dist_context import get_default_distributed_context -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py index dd7e02af854..bde0615a41d 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py @@ -17,9 +17,7 @@ import unittest import os import sys import json -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestPlannerReLaunch(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py index b9b02d749d8..3c17b6d126e 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py @@ -17,9 +17,7 @@ import unittest import os import sys import json -import shutil import subprocess -from paddle.distributed.fleet.launch_utils import run_with_coverage class TestPlannerReLaunch(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_strategy.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_strategy.py index 4d17ea10dcb..08cd1dee0e6 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_strategy.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_strategy.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os # import yaml import unittest from paddle.distributed.fleet import auto diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_to_static.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_to_static.py index 94d88a69bea..e751ef64be2 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_to_static.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_to_static.py @@ -14,14 +14,12 @@ import unittest -import os import numpy as np import paddle import paddle.nn as nn import paddle.nn.functional as F from paddle.distributed.fleet import auto -import paddle.distributed.fleet as fleet from paddle import LazyGuard from paddle.io import Dataset diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_completion.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_completion.py index f0edf8d6e2d..bba1e2ba6f1 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_completion.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_completion.py @@ -16,19 +16,13 @@ import unittest import paddle import numpy as np import paddle.nn as nn -import paddle.utils as utils import paddle.static as static import paddle.nn.functional as F from paddle.distributed.fleet import auto from paddle.distributed import fleet from paddle.distributed.auto_parallel.completion import Completer -from paddle.distributed.auto_parallel.partitioner import Partitioner -from paddle.distributed.auto_parallel.utils import make_data_unshard -from paddle.distributed.auto_parallel.dist_attribute import OperatorDistributedAttribute, TensorDistributedAttribute -from paddle.distributed.auto_parallel.dist_context import DistributedContext, get_default_distributed_context -from paddle.distributed.auto_parallel.operators import find_compatible_distributed_operator_impls -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr +from paddle.distributed.auto_parallel.dist_context import DistributedContext paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_partition.py b/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_partition.py index ee91842cb70..2e3f1d93633 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_partition.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel/test_while_op_partition.py @@ -16,7 +16,6 @@ import unittest import paddle import numpy as np import paddle.nn as nn -import paddle.utils as utils import paddle.fluid as fluid import paddle.static as static import paddle.nn.functional as F @@ -26,10 +25,7 @@ from paddle.distributed import fleet from paddle.distributed.auto_parallel.completion import Completer from paddle.distributed.auto_parallel.partitioner import Partitioner from paddle.distributed.auto_parallel.utils import make_data_unshard -from paddle.distributed.auto_parallel.dist_attribute import OperatorDistributedAttribute, TensorDistributedAttribute -from paddle.distributed.auto_parallel.dist_context import DistributedContext, get_default_distributed_context -from paddle.distributed.auto_parallel.operators import find_compatible_distributed_operator_impls -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr +from paddle.distributed.auto_parallel.dist_context import get_default_distributed_context paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/distribution/test_dirichlet_op.py b/python/paddle/fluid/tests/unittests/distribution/test_dirichlet_op.py index 27f67041d17..90209d9529b 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_dirichlet_op.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_dirichlet_op.py @@ -12,21 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re import sys -import unittest import numpy as np import paddle -import paddle.fluid.core as core -import paddle.fluid.dygraph as dg -import paddle.static as static import scipy.stats -from numpy.random import random as rand sys.path.append("../") from op_test import OpTest -from paddle.fluid import Program, program_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution.py index 028faac6e84..4d951a60960 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution.py @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import unittest import numpy as np import paddle -from paddle import fluid from paddle.distribution import * from paddle.fluid import layers diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta.py index a49a9d747ca..18315440a21 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta.py @@ -18,7 +18,6 @@ import numpy as np import paddle import scipy.stats -import config from config import ATOL, DEVICES, RTOL from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta_static.py index 6fa6b276929..8976293e36c 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_beta_static.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np 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 741fcab0438..7be3bcb5575 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_categorical.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import unittest import numpy as np diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_constraint.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_constraint.py index d061576c836..cbf0431d9f3 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_constraint.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_constraint.py @@ -18,7 +18,6 @@ import numpy as np import paddle from paddle.distribution import constraint -import config import parameterize as param np.random.seed(2022) diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet.py index 9645598d964..cb5534edcd5 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet.py @@ -18,7 +18,6 @@ import numpy as np import paddle import scipy.stats -import config from config import ATOL, DEVICES, RTOL import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py index 66103e4a917..8b0d847ad16 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py @@ -19,7 +19,7 @@ import paddle import scipy.stats from config import ATOL, DEVICES, RTOL -from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand +from parameterize import TEST_CASE_NAME, parameterize_cls, place np.random.seed(2022) paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily.py index a1fea64f165..ca54c978ca4 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily.py @@ -16,7 +16,6 @@ import unittest import numpy as np import paddle -import scipy.stats import config import mock_data as mock diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily_static.py index a2ebaca46a8..2d1493a4e52 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_expfamily_static.py @@ -16,7 +16,6 @@ import unittest import numpy as np import paddle -import scipy.stats import config import mock_data as mock diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent.py index 036d621f5c6..eef5b5a6e44 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent.py @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np import paddle -import scipy.stats import config import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent_static.py index 950e137be1d..47bf1021e1a 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_independent_static.py @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np import paddle -import scipy.stats import config import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform.py index 7f179ca5728..4f997d40bb0 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform.py @@ -17,7 +17,7 @@ import unittest import numpy as np import paddle -from paddle.distribution import constraint, transform, variable +from paddle.distribution import transform, variable import config import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform_static.py index 0375bc22921..4af17de382e 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transform_static.py @@ -16,7 +16,7 @@ import unittest import numpy as np import paddle -from paddle.distribution import transform, variable, constraint +from paddle.distribution import transform, variable import config import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution.py index 15fd94117f0..c1aebf7e0d6 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution.py @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np import paddle -import scipy.stats import config import parameterize as param diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution_static.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution_static.py index 4e4bcc1f4d4..b9f54498f64 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_transformed_distribution_static.py @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np import paddle -import scipy.stats import config import parameterize as param 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 329fda4fb3f..7b6a3a2a3bd 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_uniform.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import unittest import numpy as np diff --git a/python/paddle/fluid/tests/unittests/distribution/test_distribution_variable.py b/python/paddle/fluid/tests/unittests/distribution/test_distribution_variable.py index b0b8e8fd6fd..982a47f5e18 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_distribution_variable.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_distribution_variable.py @@ -14,12 +14,10 @@ import unittest -import numpy as np import paddle from paddle.distribution import variable from paddle.distribution import constraint -import config import parameterize as param paddle.seed(2022) diff --git a/python/paddle/fluid/tests/unittests/distribution/test_kl.py b/python/paddle/fluid/tests/unittests/distribution/test_kl.py index 6c00a6a3273..582a9f5942f 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_kl.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_kl.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np diff --git a/python/paddle/fluid/tests/unittests/distribution/test_kl_static.py b/python/paddle/fluid/tests/unittests/distribution/test_kl_static.py index b62a51c7366..f5e354e85de 100644 --- a/python/paddle/fluid/tests/unittests/distribution/test_kl_static.py +++ b/python/paddle/fluid/tests/unittests/distribution/test_kl_static.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numbers import unittest import numpy as np -- GitLab