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 1f4cf61dad5424f3eea8c60ba1b38f8f7f0bb2b3..60b47a364d82f9aaceb7adf7f98a7630ee99d435 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 197bc1516361706a4deea3e573aa8acd354cc86e..bccf0963ce1030c9393c64a7f781ddc411d320a3 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 ee8c79ff9b1ecb5afb5971a411460b5eb96c1607..3634f4258a085792e9f25455fe3debd38238343b 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 1cbc8aed1202e8e113b9a3bbe97038f1f8b82f11..ba255fba279126f0860a07bb725bcd196c169de2 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 d5d7caa7b77083f50066de02f8b33d8012b161c2..291dae6612c7612993e1b525b963c0c9ba2369fd 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 338aa9f36b45514af64ef5b29cd2be028a5bd92b..2d477434d3a9b61804b4cf2f1f790facf0940bfa 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 17735594c5a0d80fcf3d2a29d457bf4392a4cda5..deb084a79fe59054adc34c9f336a707f03c277d8 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 13382aad49bf2588174483f42e700f9801f6dfac..f70829c9fb6c77bb1a3786dc70c7291cec28c57e 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 d69b0cf342f85af8cdccde775b36fb20f1f2a961..8e148719a569179b69dd79d2b3abee2280184223 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 e19023daa68207eab663fc347af5af199c24a838..d5eb88bc6b55ac3ee03e5a2037fa7123a449e337 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 484c67f69c39b2f51ddb6bc70fadb3234a3ed9bd..3cc24a538fe081703010c9a9ad0c58c165a0a3d6 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 d2eeefcd84e205946cc83adbebf62a83e9acb033..e0b9f9d9e7588b397b12b5c121e61c12bb39029a 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 50b743c5b3a2cd4afb03c204bfe10d89cae69e1e..78f37e37db186ea1f55c9bafc5058e441e754c78 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 781b5e6b712decdcc84ed106d0d8abf3946bbcca..53734e21d9a35e7320f9ef277485a28da5506274 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 bf81b2cab829fe68e74daf08b4f71b8380e42901..745351f3d7e470520959adf5afda51d1dd70f6c5 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 debff51a2ca8cfc2554622a5b0fce99149746721..1aeed0c72ef7b427a3b0c15558506af4d05828f8 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 c0f7c8781928b4575cd84de61b832e1e1612b9c1..f57b7d8631115f9b39b190ead523825ddfddd4f9 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 40fc301f26129b8b4b229118b5147dee92a492b3..7c838513d798716e83dcd8b316170b180a6d77f9 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 75b73d06122fe0aead5b5864b5576066e830a41b..9977fb4654aa8719fd07f359307db3cb4fa708ba 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 63621256193a14da9de74e2210d0939f03a067a4..6caf9ba82c3719530a91270c01f6e2fd02e8e664 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 86eab79b58722c6522b000a0534a5f91f5415ac2..034a2cf1892355530c0fa7af5f3f8d872e6957a0 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 6072a226f92480e4d354e76fe93d752fa1995ce0..6ca0619800e93dc8dbfbf6cdbf5b73a7feb1f174 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 c31991243b697cf088b35873370eb4633531d1cc..d7bdbfd7774737493d62e2518db4a25cbc98563c 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 514246388973d81f3f6809e6257bd872bab91eb7..9f54f2a774afa8a76eef1dcf802c47491980a5dd 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 bc4918de2e57d3e57d2ecb1c659f868516432660..02797d690f23ce0512818a467641c9ec83c9b34e 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 678828f949bfd977e13ab9f13a3aef4a5c89c915..89261e6c9bf829b65ad21eb802942070adbc1e53 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 566c57a140dc9364937148fc4ca69bd0a99758b0..7d7c60f4bdd484100a412baf3101be01acf4c452 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 3dfedea46f69d7ecf8a8ae4af9635da2b259abc6..c8aba02719cbe33c6a770c7f016b2c5c22f39de0 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 3e6105917a85717232f2cd4d1c53e21ceb5f591c..fab8db0182ea75fa0e6b88bb462878dd6dd0ebd6 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 104cfb59ff5d829036c447352b0b9b2d73201fbc..7c3629182faae022918dad598ce154d38ac9296c 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 a570bd8e291fba3e4b79c265960bde193c959924..a36c142dc863acb317630bc89faa3e34ad4d17aa 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 7e990d88fa9da6af2d41dca8db55fbdeac04c6a1..8a7d9d576024db5faa4683974a9be1f7664a49f4 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 9c116a3288153a844b4ec1319c5f9fb53c2d7ba5..7077cf8acd6d4c552c0b996eec4834f8a7a9f7a5 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 e463adfc66d0aeaa007e61014949be5735a34a77..59db55596af0902a585c14295658da768bc4b07d 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 c88d0810f15ffbe90b0e2509f36e1c24ffd2a74e..68f2376a83400ebfe41ca9ecd4bf6c56b8194e44 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 ed2cf0328e85c5a12f4773ef938a31adf9fd1f4d..09de1d18c1ac5643b4dc05db15d1fbab5a2ecb4a 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 3527589db62169680d97c770b3e39d88d5db8039..bfc5eb18a065d3a65d4fe5b49bd286fec455d57b 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 e55ddbea58336665bb39aaa96ab9426a84f54fd1..7ce62fa1389f480e6cdac04dfe0cc535eaa846f6 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 b1b888d2b0da95570405c7650cf1120f7079253b..e8df938d6228200b6a7af06254da6b05644276a7 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 e7eb7ddd2a604b4ff252dd82fdb6b2f798dd1e23..c6062faa260781b572f9cbb6a7dd8201f22ab0c3 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 77e969c83bf812fffee7ac1d70dd543984495bfd..31467b6d505ed1dc88fce97cf7659ecd61cf0b72 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 b3dcd97cd20fdc3542f434959a008bd245162007..028d2b820a52b263c522cb9c85adb8ceb3e0b8a5 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 ce38780564b5be4141547f51c5025eeae4d8855f..6b83c4da24596440225407b1579db279057df24e 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 dd7e02af85469fc9f2a9d68dac81b423a4ca9fc5..bde0615a41dcd8983ce2d7d058eff81fa27feed3 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 b9b02d749d852b56b351059afe7f57e2983a0798..3c17b6d126e58d39dfec2fe01749949521331094 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 4d17ea10dcb2c3517e1dd99a039555df774ed187..08cd1dee0e6819a673cb8cb1914e517ef174628b 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 94d88a69bea357b83a9ea41a95a5e3ee07238af8..e751ef64be2d95b80d3b5bea1e535d1844bd4c44 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 f0edf8d6e2d835dea6821dab5c68477d8c9fb839..bba1e2ba6f19fc9cef11f2f2ae96d709248a6874 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 ee91842cb70f99c4dacf3aa569e6845a5be27a83..2e3f1d936338af766d30aa1a629b3e60bf017690 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 27f67041d175946e6fce0e0c9ee17df38fa04a47..90209d9529b2360db0fc82b7995a8c23c6934cd1 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 028faac6e84082cc5982cb7a60774bec96797d5e..4d951a609608ad5864984f28a3248ad21f63eef0 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 a49a9d747ca0b4b69974c4a67f46e528b4ad3081..18315440a21dc7598d81c92554d7bd270119d602 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 6fa6b2769298b7f2a248ad7cae5571461819307c..8976293e36c0945f72ac5a33bed07d4148698751 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 741fcab0438dbf0ea3abe1656c963d2a2710bee4..7be3bcb55751c8d6442368f51f5457f614a05723 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 d061576c83644515bdf9e09b4894e6a39be41f34..cbf0431d9f34ab611b7ff51fc03c63cb89bfd3f4 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 9645598d964257da0fea206492bac39f8aff74f1..cb5534edcd54163686a0c49a153d7f4765a6fd1d 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 66103e4a91749703ed894806c493b28e5436f892..8b0d847ad16e7f4f3fcfe91da2b46d5e75567038 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 a1fea64f165c43a2ec0f6e66b89b551846e558c1..ca54c978ca4eeab65559d5638cac85bba42d2163 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 a2ebaca46a802c721bd6d68a5b538d9b018fa56b..2d1493a4e52f199a27593e594126c3426aaebe78 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 036d621f5c66b6b6040ddac697c248e8b8a8f2d9..eef5b5a6e442cbcb4f25d2c6c042af3d811a2b83 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 950e137be1dd552464c7e412f9c754ac1b6e9b3c..47bf1021e1a3a5ccf6f1285018c426b5910cef76 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 7f179ca572871af1cc4cab615d8583f0e953331f..4f997d40bb0942804fa6717ccbc2f2ef2f115a32 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 0375bc229212a518db30b871d2d15c222a440dbc..4af17de382e251b8f71cadb1665d57a0a13506e4 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 15fd94117f0080ab10f6ff13ff62654fc3bc4003..c1aebf7e0d66f7876f0b86003218b9ab96956534 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 4e4bcc1f4d402b11a3c1cc1e26a7f865eb57a088..b9f54498f64d8aa05a52d9d0a9787a7e79ee7b91 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 329fda4fb3feb3fe9c351b2d3d350fb38e9a1231..7b6a3a2a3bd02abf8123f8ff19c040be1fdadd84 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 b0b8e8fd6fd6f7ebeb5745c550bd12ea26297b5a..982a47f5e180656d2ffce44845f7ff1cd92a98d5 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 6c00a6a3273ed57054ec96b34ca4bfbeb6b79cef..582a9f5942f903b6ae3ff173919d468e903a59e0 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 b62a51c73663bd480f8e69ad85c1267ce0137d62..f5e354e85de58a6e2241ce35a104843c92f81005 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