diff --git a/python/paddle/fluid/tests/unittests/ascend_group.py b/python/paddle/fluid/tests/unittests/ascend_group.py index 1d3f308a61117f091be73d7d88d3b4175b55a125..32b42a00fc657104d95c421432827454ee925ae0 100644 --- a/python/paddle/fluid/tests/unittests/ascend_group.py +++ b/python/paddle/fluid/tests/unittests/ascend_group.py @@ -13,15 +13,13 @@ # limitations under the License. import os -import sys -import time import paddle.fluid as fluid from paddle.fluid import unique_name import paddle.fluid.core as core import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.distributed import fleet -from paddle.distributed.fleet.meta_optimizers.ascend import ascend_parser, ascend_optimizer +from paddle.distributed.fleet.meta_optimizers.ascend import ascend_optimizer from collections import namedtuple Block = namedtuple('Block', ['program']) diff --git a/python/paddle/fluid/tests/unittests/ascend_multi_process_collective.py b/python/paddle/fluid/tests/unittests/ascend_multi_process_collective.py index bb2180a733f818f81963e9702c854a78488a7592..1853e529d51dc0ad3e055fd62792506cf56d932d 100644 --- a/python/paddle/fluid/tests/unittests/ascend_multi_process_collective.py +++ b/python/paddle/fluid/tests/unittests/ascend_multi_process_collective.py @@ -14,7 +14,6 @@ import os import sys -import time def train(prefix): diff --git a/python/paddle/fluid/tests/unittests/auto_checkpoint_utils.py b/python/paddle/fluid/tests/unittests/auto_checkpoint_utils.py index 47db2793dc08f6ec4bb14b481e28547f90f6274e..4303c56675b21396f63d026cb41c396785403df9 100644 --- a/python/paddle/fluid/tests/unittests/auto_checkpoint_utils.py +++ b/python/paddle/fluid/tests/unittests/auto_checkpoint_utils.py @@ -13,21 +13,14 @@ # limitations under the License. import unittest -import paddle import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel from paddle.fluid.framework import program_guard from paddle.fluid import unique_name import numpy as np -from paddle.io import Dataset, BatchSampler, DataLoader BATCH_NUM = 4 BATCH_SIZE = 1 diff --git a/python/paddle/fluid/tests/unittests/auto_parallel_autoconvert.py b/python/paddle/fluid/tests/unittests/auto_parallel_autoconvert.py index f730f83c961757fce32a3dffd50768e27a89dc23..b8c64c0af5454b3138831cea35e3430a5982c931 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel_autoconvert.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel_autoconvert.py @@ -16,7 +16,6 @@ import unittest import random import numpy as np import os -import shutil import paddle import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/auto_parallel_data_unshard.py b/python/paddle/fluid/tests/unittests/auto_parallel_data_unshard.py index 04af950e8114d43637d3a490b91aefd3c5124b0c..e08739039c8acad934c0ca933b43b6022bc862db 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel_data_unshard.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel_data_unshard.py @@ -14,13 +14,11 @@ import unittest -import copy import numpy as np import random import paddle import paddle.nn as nn -import paddle.fluid.core as core from paddle.distributed.fleet import auto import paddle.nn.functional as F from paddle.distributed import fleet diff --git a/python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py b/python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py index b8bbe582cbecccedd8e5a905e95a1b66a486a0d6..027f4a8e0d766f63e4f729385ae8e56dfd97671f 100644 --- a/python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py +++ b/python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py @@ -13,19 +13,14 @@ # limitations under the License. import collections -import random -import numpy as np import paddle import paddle.nn as nn import paddle.nn.functional as F import paddle.tensor as tensor from paddle.distributed.fleet import auto -from paddle import fluid from paddle.fluid import layers -from paddle.distributed import fleet from paddle.nn.layer.transformer import _convert_param_attr_to_list -from paddle.fluid.initializer import Normal, NumpyArrayInitializer paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/benchmark.py b/python/paddle/fluid/tests/unittests/benchmark.py index 11f815333f3e1800a6a9c44b29b4c297f6da4a69..9e6278dd32f88e46284606e832df4188f7c86343 100644 --- a/python/paddle/fluid/tests/unittests/benchmark.py +++ b/python/paddle/fluid/tests/unittests/benchmark.py @@ -13,13 +13,9 @@ # limitations under the License. import numpy as np -import unittest import time -import itertools import six -import paddle.fluid as fluid -import paddle.fluid.core as core from paddle.fluid.op import Operator from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/benchmark_sum_op.py b/python/paddle/fluid/tests/unittests/benchmark_sum_op.py index 3f2e597b0d6f7b6818aa039f7521045a657d5614..d3d909e17e49d9d8c2125fbcd432722a14397750 100644 --- a/python/paddle/fluid/tests/unittests/benchmark_sum_op.py +++ b/python/paddle/fluid/tests/unittests/benchmark_sum_op.py @@ -15,9 +15,7 @@ import unittest import numpy as np -import paddle.fluid as fluid from benchmark import BenchmarkSuite -from op_test import OpTest # This is a demo op test case for operator benchmarking and high resolution number stability alignment. diff --git a/python/paddle/fluid/tests/unittests/c_embedding_op_base.py b/python/paddle/fluid/tests/unittests/c_embedding_op_base.py index e7e93ac1b7947bccf7ea6def61005bff9453eba4..ef3c942d2b09681d66ae25cce84cdf7f1bde1a3e 100644 --- a/python/paddle/fluid/tests/unittests/c_embedding_op_base.py +++ b/python/paddle/fluid/tests/unittests/c_embedding_op_base.py @@ -15,8 +15,6 @@ import unittest import numpy as np from op_test import OpTest -import paddle -import paddle.fluid as fluid from paddle.framework import core SEED = 2021 diff --git a/python/paddle/fluid/tests/unittests/check_nan_inf_base.py b/python/paddle/fluid/tests/unittests/check_nan_inf_base.py index 025772783c5cda2a8e49d250a28a85e2c77c08c3..1c4bfd387c42c17987ea1f542b05b6d98ec3e20d 100644 --- a/python/paddle/fluid/tests/unittests/check_nan_inf_base.py +++ b/python/paddle/fluid/tests/unittests/check_nan_inf_base.py @@ -13,8 +13,6 @@ # limitations under the License. import os -import sys -import time import numpy as np os.environ[str("FLAGS_check_nan_inf")] = str("1") @@ -23,7 +21,6 @@ os.environ[str("GLOG_vmodule")] = str("nan_inf_utils_detail=10") import paddle.fluid.core as core import paddle import paddle.fluid as fluid -import paddle.compat as cpt paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/check_nan_inf_base_dygraph.py b/python/paddle/fluid/tests/unittests/check_nan_inf_base_dygraph.py index 83cca20cda443c6c0f701574c80a39e024bbbfc0..9622ee4e9a92e1f0b06b07f9355cd4de77c26218 100644 --- a/python/paddle/fluid/tests/unittests/check_nan_inf_base_dygraph.py +++ b/python/paddle/fluid/tests/unittests/check_nan_inf_base_dygraph.py @@ -13,8 +13,6 @@ # limitations under the License. import os -import sys -import time import numpy as np os.environ[str("FLAGS_check_nan_inf")] = str("1") diff --git a/python/paddle/fluid/tests/unittests/collective/communication_stream_allgather_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/communication_stream_allgather_api_dygraph.py index d0e46600b8b50f3b43b149ac0b851121ecc4fa74..f4ff1e5b7b37cc8bf9e94a636f8d9c8be40f5cf7 100644 --- a/python/paddle/fluid/tests/unittests/collective/communication_stream_allgather_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/communication_stream_allgather_api_dygraph.py @@ -15,9 +15,7 @@ import os import numpy as np import paddle -import paddle.fluid as fluid import paddle.distributed as dist -import test_communication_api_base as test_base import test_collective_api_base as test_collective_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allgather_api.py b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allgather_api.py index 254b64907ce07facc79f42906d5109f0a26b2f95..306248a03354249f17ddf4624861e62c4c52dc17 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allgather_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allgather_api.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import paddle -import itertools import test_communication_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective_allgather_op.py b/python/paddle/fluid/tests/unittests/collective_allgather_op.py index d8e749ff93be68f18d3d44e17d2922ed215902b2..e897e1638852fc78dcb02b190b65d08a1376c258 100644 --- a/python/paddle/fluid/tests/unittests/collective_allgather_op.py +++ b/python/paddle/fluid/tests/unittests/collective_allgather_op.py @@ -12,24 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective_reducescatter.py b/python/paddle/fluid/tests/unittests/collective_reducescatter.py index c2cf7f8c26792d64583f3959c6047f85d866c5a0..480f9aeb3805fd55d03d0884b3495d9857093d72 100644 --- a/python/paddle/fluid/tests/unittests/collective_reducescatter.py +++ b/python/paddle/fluid/tests/unittests/collective_reducescatter.py @@ -12,24 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective_reducescatter_op.py b/python/paddle/fluid/tests/unittests/collective_reducescatter_op.py index e3c01c1bcfec6b9ff9ba5506cd4585bc9f2b4bed..042817f8c3f2ca66cc4c7ff97a465dacec293de6 100644 --- a/python/paddle/fluid/tests/unittests/collective_reducescatter_op.py +++ b/python/paddle/fluid/tests/unittests/collective_reducescatter_op.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/detected_gpu.py b/python/paddle/fluid/tests/unittests/detected_gpu.py index 28e0cc78760302fafc6f7f191fb3078c6c4f796c..47287278ed96d4693270924f66fc9b418ad6d396 100644 --- a/python/paddle/fluid/tests/unittests/detected_gpu.py +++ b/python/paddle/fluid/tests/unittests/detected_gpu.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle import sys import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/detected_xpu.py b/python/paddle/fluid/tests/unittests/detected_xpu.py index a1b4b2ec1ecfffeeddf2c94d87be943b64178b19..dfc169307af72dd4a0da50cb5d994a666613e00a 100644 --- a/python/paddle/fluid/tests/unittests/detected_xpu.py +++ b/python/paddle/fluid/tests/unittests/detected_xpu.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle import sys import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/dist_allreduce_op.py b/python/paddle/fluid/tests/unittests/dist_allreduce_op.py index 2e1358deabe8e537888be7034750195dbec5445f..49ef5d64bc73b67452b0fc010fa28a6c8c9befaa 100644 --- a/python/paddle/fluid/tests/unittests/dist_allreduce_op.py +++ b/python/paddle/fluid/tests/unittests/dist_allreduce_op.py @@ -12,19 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_ctr.py b/python/paddle/fluid/tests/unittests/dist_fleet_ctr.py index 8d1071ccda074769e3dca40c8ec81807eaa38f73..53ef00064bfca9f63127c029822711062b2217ba 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_ctr.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_ctr.py @@ -26,8 +26,6 @@ import numpy as np import ctr_dataset_reader from test_dist_fleet_base import runtime_main, FleetDistRunnerBase -from paddle.distributed.fleet.utils.ps_util import DistributedInfer -import paddle.distributed.fleet as fleet paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_ctr_ps_gpu.py b/python/paddle/fluid/tests/unittests/dist_fleet_ctr_ps_gpu.py index 9f927a5bb3b8f6614b406d5b5e66e7be72fd63d8..13ec262697e5d61d4af5aa04b954be1ee8b767f7 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_ctr_ps_gpu.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_ctr_ps_gpu.py @@ -25,7 +25,7 @@ import os import numpy as np import ctr_dataset_reader -from test_dist_fleet_base import runtime_main, FleetDistRunnerBase +from test_dist_fleet_base import runtime_main from dist_fleet_ctr import TestDistCTR2x2, fake_ctr_reader # Fix seed for test diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_debug_gloo.py b/python/paddle/fluid/tests/unittests/dist_fleet_debug_gloo.py index 246404eb8ad5acbd39654d1b58996fd007749a9e..82f7a2bc672edf22920382e5367ab48e971501aa 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_debug_gloo.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_debug_gloo.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import time -import numpy as np import logging -import paddle -import paddle.fluid as fluid #import paddle.fluid.incubate.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet -from paddle.fluid.transpiler.distribute_transpiler import DistributeTranspilerConfig logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s") logger = logging.getLogger("fluid") diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py b/python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py index eb3f51a0240884935f6e6683a765e1a6e44009ed..c4e78ba16e05e83a21dbce9864b42db8e449ccf0 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py @@ -15,18 +15,14 @@ Distribute CTR model for test fleet api """ -import shutil -import tempfile import time import paddle import paddle.fluid as fluid import os -import numpy as np import ctr_dataset_reader from test_dist_fleet_heter_base import runtime_main, FleetDistHeterRunnerBase -from dist_fleet_ctr import TestDistCTR2x2, fake_ctr_reader paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer.py b/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer.py index 50a2089cd177e5afcb0ea33e06a2e3093040007a..54c37822257776516cd65664151442c4ed5b8572 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer.py @@ -13,12 +13,9 @@ # limitations under the License. from test_dist_base import TestDistRunnerBase, runtime_main -import unittest import paddle -import os import paddle.distributed.fleet as fleet import paddle.distributed.fleet.base.role_maker as role_maker -import numpy as np from functools import reduce import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer_fuse_allreduce.py b/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer_fuse_allreduce.py index 003de5458786e33a01af2e40608c83c6f58238e9..5db0377b36a0e9a1417559c2a1bc70d5b856478a 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer_fuse_allreduce.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_raw_program_optimizer_fuse_allreduce.py @@ -13,12 +13,9 @@ # limitations under the License. from test_dist_base import TestDistRunnerBase, runtime_main -import unittest import paddle -import os import paddle.distributed.fleet as fleet import paddle.distributed.fleet.base.role_maker as role_maker -import numpy as np from functools import reduce import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_simnet_bow.py b/python/paddle/fluid/tests/unittests/dist_fleet_simnet_bow.py index 4b6cef5d4b9b507e01c79da1845370e909893e3f..84687999d9c5051f53f61342d6e68be4d54fe643 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_simnet_bow.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_simnet_bow.py @@ -13,22 +13,11 @@ # limitations under the License. import numpy as np -import argparse import time -import math -import random -import shutil -import tempfile import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process import os -import signal -from functools import reduce from test_dist_fleet_base import runtime_main, FleetDistRunnerBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/dist_fleet_sparse_embedding_ctr.py b/python/paddle/fluid/tests/unittests/dist_fleet_sparse_embedding_ctr.py index b7130ee1b331cd126a2a870bdb23c90beb73b046..c6a976b089b4ab52077dedc8c20064c0e3d3a2c2 100644 --- a/python/paddle/fluid/tests/unittests/dist_fleet_sparse_embedding_ctr.py +++ b/python/paddle/fluid/tests/unittests/dist_fleet_sparse_embedding_ctr.py @@ -16,9 +16,7 @@ Distribute CTR model for test fleet api """ import os -import time -import random import numpy as np import paddle diff --git a/python/paddle/fluid/tests/unittests/dist_mnist.py b/python/paddle/fluid/tests/unittests/dist_mnist.py index 47009dff2df56b64ac6234af37ef33bd99d5e81c..1a0f61411a3ace7bebc24d74d4f8fd08be213305 100644 --- a/python/paddle/fluid/tests/unittests/dist_mnist.py +++ b/python/paddle/fluid/tests/unittests/dist_mnist.py @@ -12,22 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main -from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy +from paddle.fluid.incubate.fleet.collective import fleet paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/dist_mnist_batch_merge.py b/python/paddle/fluid/tests/unittests/dist_mnist_batch_merge.py index 1ae4822d0ed098ecb1ed496f365289207c890e8a..67981130fc265ee7f4fc48973cd7dfba84b9ab85 100644 --- a/python/paddle/fluid/tests/unittests/dist_mnist_batch_merge.py +++ b/python/paddle/fluid/tests/unittests/dist_mnist_batch_merge.py @@ -12,20 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main from dist_mnist import cnn_model diff --git a/python/paddle/fluid/tests/unittests/dist_mnist_lars.py b/python/paddle/fluid/tests/unittests/dist_mnist_lars.py index 9c765ba15659e09389a42e40e9bc5b7bbf439d75..b93dfb0594eda43f29b635fcd2632f43730d1bbe 100644 --- a/python/paddle/fluid/tests/unittests/dist_mnist_lars.py +++ b/python/paddle/fluid/tests/unittests/dist_mnist_lars.py @@ -12,20 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main from dist_mnist import cnn_model diff --git a/python/paddle/fluid/tests/unittests/dist_save_load.py b/python/paddle/fluid/tests/unittests/dist_save_load.py index 8dbdd23fa855ba5f5104dfd0e974adaea8a3e2c1..b88e43ebad037de572daca2e37570c09608ef58c 100644 --- a/python/paddle/fluid/tests/unittests/dist_save_load.py +++ b/python/paddle/fluid/tests/unittests/dist_save_load.py @@ -14,18 +14,9 @@ import os import sys -import signal -import subprocess -import argparse -import time -import math -import random -from multiprocessing import Process -from functools import reduce import numpy as np import pickle -import unittest import six import paddle @@ -33,7 +24,7 @@ import paddle.fluid as fluid from paddle.fluid import core from paddle.fluid import io -from test_dist_base import TestDistRunnerBase, runtime_main, RUN_STEP +from test_dist_base import RUN_STEP, runtime_main from dist_simnet_bow import TestDistSimnetBow2x2, DATA_URL, DATA_MD5 diff --git a/python/paddle/fluid/tests/unittests/dist_se_resnext.py b/python/paddle/fluid/tests/unittests/dist_se_resnext.py index 269301f7b0da797876667897ff31a6eae3c065f7..5061bb8595615e234ca90d2cb54aad8480b6666a 100644 --- a/python/paddle/fluid/tests/unittests/dist_se_resnext.py +++ b/python/paddle/fluid/tests/unittests/dist_se_resnext.py @@ -12,20 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import sys -import signal from test_dist_base import TestDistRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/dist_sharding_save.py b/python/paddle/fluid/tests/unittests/dist_sharding_save.py index 0fbc99cbf61af365bb09dd934cc6b73ec58e9f0d..b4733b61af85a8fcd9389306374af0ce49414dc2 100755 --- a/python/paddle/fluid/tests/unittests/dist_sharding_save.py +++ b/python/paddle/fluid/tests/unittests/dist_sharding_save.py @@ -14,10 +14,7 @@ import paddle import paddle.fluid as fluid -from test_dist_base import TestDistRunnerBase -from dist_mnist import cnn_model -# from paddle.fluid.incubate.fleet.collective import fleet -import paddle.distributed.fleet as fleet +from dist_mnist import cnn_model # noqa: F401 import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.meta_optimizers.sharding as sharding diff --git a/python/paddle/fluid/tests/unittests/dist_text_classification.py b/python/paddle/fluid/tests/unittests/dist_text_classification.py index f794e0be6d9eadf32001f553cd7e0bc087dd57a3..9b29d6b138b69ad855dd91b8038c96281f8c8fb5 100644 --- a/python/paddle/fluid/tests/unittests/dist_text_classification.py +++ b/python/paddle/fluid/tests/unittests/dist_text_classification.py @@ -12,24 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process import os -import signal import six import tarfile import string import re -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main DTYPE = "float32" diff --git a/python/paddle/fluid/tests/unittests/dist_transformer.py b/python/paddle/fluid/tests/unittests/dist_transformer.py index 7b514e4d57226b33aa561806ffc18c6e51f8522e..b37b70cfeed67fde49bb6f2bdcf28fce03f2030a 100644 --- a/python/paddle/fluid/tests/unittests/dist_transformer.py +++ b/python/paddle/fluid/tests/unittests/dist_transformer.py @@ -13,15 +13,9 @@ # limitations under the License. import numpy as np -import argparse import time -import math import os -import sys import six -import argparse -import ast -import multiprocessing import time from functools import partial from os.path import expanduser @@ -29,16 +23,12 @@ import glob import random import tarfile -import paddle import paddle.fluid as fluid import paddle.fluid.layers as layers -from paddle.fluid import core from test_dist_base import TestDistRunnerBase, runtime_main, RUN_STEP import paddle.compat as cpt from paddle.compat import long_type -import hashlib - const_para_attr = fluid.ParamAttr(initializer=fluid.initializer.Constant(0.001)) const_bias_attr = const_para_attr diff --git a/python/paddle/fluid/tests/unittests/dist_word2vec.py b/python/paddle/fluid/tests/unittests/dist_word2vec.py index 7f420f764c079c2da052bd5e36a8ec603f217b73..ca322d30cdc62d971f0fb4d5dcfa711634025c60 100644 --- a/python/paddle/fluid/tests/unittests/dist_word2vec.py +++ b/python/paddle/fluid/tests/unittests/dist_word2vec.py @@ -12,18 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process import os -import signal from test_dist_base import TestDistRunnerBase, runtime_main IS_SPARSE = True diff --git a/python/paddle/fluid/tests/unittests/distributed_fused_lamb_test_base.py b/python/paddle/fluid/tests/unittests/distributed_fused_lamb_test_base.py index 3216f19b5c4a2daa16973972c04c2090d7dd3f27..230272a1cff77a3cb3dbc445de3b2f6406c25d26 100644 --- a/python/paddle/fluid/tests/unittests/distributed_fused_lamb_test_base.py +++ b/python/paddle/fluid/tests/unittests/distributed_fused_lamb_test_base.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import argparse import os import paddle import paddle.fluid.core as core @@ -21,11 +20,9 @@ from paddle.incubate import DistributedFusedLamb from paddle.vision.models import resnet18 as resnet from paddle.distributed.fleet.meta_optimizers.common import CollectiveHelper from paddle.fluid.clip import ClipGradBase -import paddle.nn as nn import numpy as np import os import unittest -from paddle.distributed.fleet.meta_optimizers.common import is_optimizer_op, is_backward_op from paddle.fluid.clip import _clip_by_global_norm_using_mp_type import distutils diff --git a/python/paddle/fluid/tests/unittests/dygraph_fleet_api.py b/python/paddle/fluid/tests/unittests/dygraph_fleet_api.py index 8e74efa3ceb691f9c70bbea8c0044c3b0751cce4..bf6139ffae680cf2d24f819714e76f432a724502 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_fleet_api.py +++ b/python/paddle/fluid/tests/unittests/dygraph_fleet_api.py @@ -15,17 +15,9 @@ import unittest import random import numpy as np -import os -import shutil import paddle -import paddle.nn as nn -from paddle.fluid import core -import datetime -from datetime import timedelta -import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard -from paddle.fluid.dygraph.parallel import ParallelEnv class TestDygraphFleetAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/dygraph_recompute_hybrid.py b/python/paddle/fluid/tests/unittests/dygraph_recompute_hybrid.py index e67854437b1938695788057d8fd39b7fdf755cc7..105621498fed6fb424468b8afd0b6175b8449f88 100755 --- a/python/paddle/fluid/tests/unittests/dygraph_recompute_hybrid.py +++ b/python/paddle/fluid/tests/unittests/dygraph_recompute_hybrid.py @@ -16,14 +16,10 @@ import unittest import numpy as np import paddle -from paddle.autograd import PyLayer -from paddle.distributed.fleet.utils import recompute from paddle.incubate.distributed.fleet import recompute_hybrid import random from paddle.distributed import fleet -import paddle.fluid.layers as layers - def get_fc_block(block_idx, input_size, is_last=False): block_name = "block_" + str(block_idx) diff --git a/python/paddle/fluid/tests/unittests/find_ports.py b/python/paddle/fluid/tests/unittests/find_ports.py index b467a49213dd02b3160077ec63e79bda90094209..5618d4034483186d2b84d3f75b6e6075ce454c24 100644 --- a/python/paddle/fluid/tests/unittests/find_ports.py +++ b/python/paddle/fluid/tests/unittests/find_ports.py @@ -14,7 +14,6 @@ import os import sys -import time def train(): diff --git a/python/paddle/fluid/tests/unittests/fleet_heter_ps_training.py b/python/paddle/fluid/tests/unittests/fleet_heter_ps_training.py index 3748894f4effdc588d80df28de0b58d307608c0e..e99021f282291d81bdcfa6be89fa612ecfd0c5ec 100644 --- a/python/paddle/fluid/tests/unittests/fleet_heter_ps_training.py +++ b/python/paddle/fluid/tests/unittests/fleet_heter_ps_training.py @@ -15,7 +15,6 @@ import paddle import paddle.fluid as fluid import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker fluid.disable_dygraph() diff --git a/python/paddle/fluid/tests/unittests/gradient_checker.py b/python/paddle/fluid/tests/unittests/gradient_checker.py index cee793f3ae967f2b30cdb4df8cd1c5976c3a071f..b947ff3bc4af30e1dbd6d2de9805767b1e63bb6a 100644 --- a/python/paddle/fluid/tests/unittests/gradient_checker.py +++ b/python/paddle/fluid/tests/unittests/gradient_checker.py @@ -13,16 +13,13 @@ # limitations under the License. """This is the lib for gradient checker unittest.""" -import unittest import six -import collections import numpy as np from itertools import product import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.executor import Executor from paddle.fluid.backward import _append_grad_suffix_, _as_list from paddle.fluid.framework import _test_eager_guard try: diff --git a/python/paddle/fluid/tests/unittests/hccl_tools.py b/python/paddle/fluid/tests/unittests/hccl_tools.py index ab35b36161b7902c8cf1a8f4bbc7dbe2bebf9e10..f47fe9962fe6d9bf283da77c544fd0520f3fbbe1 100644 --- a/python/paddle/fluid/tests/unittests/hccl_tools.py +++ b/python/paddle/fluid/tests/unittests/hccl_tools.py @@ -34,7 +34,6 @@ import sys import json import socket from argparse import ArgumentParser -from typing import Dict, Any def parse_args(): diff --git a/python/paddle/fluid/tests/unittests/hdfs_test_utils.py b/python/paddle/fluid/tests/unittests/hdfs_test_utils.py index 2dfa86f976644c3495a8ec156fc0bebe60c40f70..0f87e5603360110aabbe98b62743aa0323609190 100644 --- a/python/paddle/fluid/tests/unittests/hdfs_test_utils.py +++ b/python/paddle/fluid/tests/unittests/hdfs_test_utils.py @@ -13,13 +13,9 @@ # limitations under the License. import unittest -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient, FSTimeOut, FSFileExistsError, FSFileNotExistsError +from paddle.distributed.fleet.utils.fs import FSFileExistsError, FSFileNotExistsError, HDFSClient, LocalFS java_home = os.environ["JAVA_HOME"] diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_layer.py b/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_layer.py index c1609c975e6835c23b559a619a69706bb2fc6283..7cdce186cf8bc76261cb97570f723ecdb47d9e45 100644 --- a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_layer.py +++ b/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_layer.py @@ -14,8 +14,6 @@ import unittest import numpy as np -import os -import paddle from paddle.distributed import fleet from paddle.fluid.dygraph.container import Sequential import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/ir_memory_optimize_net_base.py b/python/paddle/fluid/tests/unittests/ir_memory_optimize_net_base.py index cc3e1c2961efd32dc7ae5e42d5042e4647833374..ca518747821b03116669c2c0c8b87c78669d7829 100644 --- a/python/paddle/fluid/tests/unittests/ir_memory_optimize_net_base.py +++ b/python/paddle/fluid/tests/unittests/ir_memory_optimize_net_base.py @@ -14,11 +14,9 @@ import os import sys -import six import unittest import time import math -import multiprocessing import numpy as np import paddle diff --git a/python/paddle/fluid/tests/unittests/launch_function_helper.py b/python/paddle/fluid/tests/unittests/launch_function_helper.py index d5eb73057b9a6e46a9aec6b241b69515edd85386..992bc58b5e490a9b547c049b3790c65204254a97 100644 --- a/python/paddle/fluid/tests/unittests/launch_function_helper.py +++ b/python/paddle/fluid/tests/unittests/launch_function_helper.py @@ -11,7 +11,7 @@ # 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. -from multiprocessing import Pool, Process +from multiprocessing import Process import os import socket from contextlib import closing diff --git a/python/paddle/fluid/tests/unittests/my_data_generator.py b/python/paddle/fluid/tests/unittests/my_data_generator.py index 00fd636467c2f239cdae863f48dfe87fd06dadca..5279973e01acfcdeabf80731df4771808a165f2c 100644 --- a/python/paddle/fluid/tests/unittests/my_data_generator.py +++ b/python/paddle/fluid/tests/unittests/my_data_generator.py @@ -12,12 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import os -import paddle -import re -import collections -import time import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/nproc_process.py b/python/paddle/fluid/tests/unittests/nproc_process.py index e8b8ea11440d13595fe9cd88e9bd2da76b46182f..bbd0b6a0e5ee6a619ddaf0702345dbcdff2778fc 100644 --- a/python/paddle/fluid/tests/unittests/nproc_process.py +++ b/python/paddle/fluid/tests/unittests/nproc_process.py @@ -14,7 +14,6 @@ import os import sys -import time import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/op_test.py b/python/paddle/fluid/tests/unittests/op_test.py index 18eaae293b3df07f43e754d1dadb5042d493cdae..e4360253aeeae4cb37ee9857b97a879fd3aa3514 100644 --- a/python/paddle/fluid/tests/unittests/op_test.py +++ b/python/paddle/fluid/tests/unittests/op_test.py @@ -20,9 +20,6 @@ import numpy as np import random import six import struct -import time -import itertools -import collections from collections import defaultdict from copy import copy @@ -35,7 +32,7 @@ from paddle.fluid.framework import _test_eager_guard from paddle.fluid.backward import append_backward from paddle.fluid.op import Operator from paddle.fluid.executor import Executor -from paddle.fluid.framework import Program, OpProtoHolder, Variable, _current_expected_place +from paddle.fluid.framework import OpProtoHolder, Program, _current_expected_place from paddle.fluid import unique_name from paddle.fluid.dygraph.dygraph_to_static.utils import parse_arg_and_kwargs @@ -1423,7 +1420,6 @@ class OpTest(unittest.TestCase): judge whether convert current output and expect to uint16. return True | False """ - pass def _is_skip_name(self, name): if name not in self.expects: diff --git a/python/paddle/fluid/tests/unittests/op_test_xpu.py b/python/paddle/fluid/tests/unittests/op_test_xpu.py index 8c5348deae93ab21b841b68783c7fd15a137df57..82c8eb73969f153c8e4b7af63d3e7561d25144ea 100644 --- a/python/paddle/fluid/tests/unittests/op_test_xpu.py +++ b/python/paddle/fluid/tests/unittests/op_test_xpu.py @@ -12,30 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import unittest -import warnings import numpy as np -import random -import six -import struct -import time -import itertools -import collections -from collections import defaultdict import paddle import paddle.fluid as fluid import paddle.fluid.core as core from paddle.fluid.backward import append_backward -from paddle.fluid.op import Operator -from paddle.fluid.executor import Executor -from paddle.fluid.framework import Program, OpProtoHolder, Variable, convert_np_dtype_to_dtype_ -from testsuite import create_op, set_input, append_input_output, append_loss_ops -from paddle.fluid import unique_name -from white_list import op_accuracy_white_list, check_shape_white_list, compile_vs_runtime_white_list, no_check_set_white_list +from paddle.fluid.framework import Program, convert_np_dtype_to_dtype_ +from testsuite import append_loss_ops, create_op, set_input from white_list import op_threshold_white_list, no_grad_set_white_list -from op_test import OpTest, _set_use_system_allocator, get_numeric_gradient +from op_test import OpTest from xpu.get_test_cover_info import is_empty_grad_op_type, get_xpu_op_support_types, type_dict_str_to_numpy diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_dataparallel_with_pylayer.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_dataparallel_with_pylayer.py index e2e7d1ff94bed04a117bada7acec161568a65484..b85caf2c966ec4fa79c0586ea6de8458144e8348 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_dataparallel_with_pylayer.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_dataparallel_with_pylayer.py @@ -17,9 +17,7 @@ import unittest import paddle import numpy as np import paddle.distributed as dist -from paddle.fluid.dygraph.nn import Linear from paddle.autograd import PyLayer -from paddle.fluid.framework import in_dygraph_mode, _in_legacy_dygraph from paddle.distributed.fleet.utils.hybrid_parallel_util import fused_allreduce_gradients batch = 5 diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check.py index 6826c86b0d61e330c4172864b19d2b86c98d555a..bb66e117f339e35cedd873c533345cfca5097388 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import os import paddle import numpy as np diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check_in_eager_mode.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check_in_eager_mode.py index 4f6d4a7716c9331e915ac42467748c4acee59629..506e025225d42817b043a60065bd8d5717667bfa 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check_in_eager_mode.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_gradient_check_in_eager_mode.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import os -import copy import paddle import numpy as np @@ -22,8 +20,6 @@ import paddle.distributed as dist import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.fluid.framework import _test_eager_guard -from paddle.fluid.dygraph.parallel import ParallelEnv -import paddle.fluid.core as core paddle.seed(1024) np.random.seed(2021) diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_mnist.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_mnist.py index 8917a82325d63d131fb469a4f12c1e82bef0455a..8b07142ac2efb518f06e206e59ea0ef53731de92 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_mnist.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_mnist.py @@ -12,18 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import contextlib -import unittest import numpy as np -import six -import pickle import paddle import paddle.fluid as fluid -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core -from paddle.fluid.optimizer import SGDOptimizer from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear from paddle.fluid.dygraph.base import to_variable diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_none_var.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_none_var.py index 8659da4d65847d3f3a29e87a9636d194b1ab0d18..5713c93920f75e3c92ea1b54ab26c409aa50417b 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_none_var.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_none_var.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import contextlib -import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core -from paddle.fluid.optimizer import SGDOptimizer -from paddle.fluid.dygraph.nn import Linear from test_dist_base import runtime_main, TestParallelDyGraphRunnerBase diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py index f41a872cc501785587bbc123e201d4368c92ebcd..851bf3b2fdc89eb2b32e96ad0f32dd032d8fd8ed 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import numpy as np import paddle import paddle.fluid as fluid -from paddle.fluid.optimizer import SGDOptimizer -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear +from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.base import to_variable from test_dist_base import runtime_main, TestParallelDyGraphRunnerBase diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_sparse_embedding_over_height.py b/python/paddle/fluid/tests/unittests/parallel_dygraph_sparse_embedding_over_height.py index 5068853f5c5e5e91364adc5fe56fdfae00a6f9be..7bd30deea6407078f91f9250628e4c2a6284e413 100644 --- a/python/paddle/fluid/tests/unittests/parallel_dygraph_sparse_embedding_over_height.py +++ b/python/paddle/fluid/tests/unittests/parallel_dygraph_sparse_embedding_over_height.py @@ -16,7 +16,7 @@ import paddle import paddle.fluid as fluid from parallel_dygraph_sparse_embedding import SimpleNet, fake_sample_reader, TestSparseEmbedding -from test_dist_base import runtime_main, TestParallelDyGraphRunnerBase +from test_dist_base import runtime_main # global configs # using small `vocab_size` to test rows number over height diff --git a/python/paddle/fluid/tests/unittests/ps_dnn_model.py b/python/paddle/fluid/tests/unittests/ps_dnn_model.py index 8841ea742f0c9d51f0ab47236895be79745bc04a..89472c73bd31dde5c27c111ba7f241a5a93d6510 100755 --- a/python/paddle/fluid/tests/unittests/ps_dnn_model.py +++ b/python/paddle/fluid/tests/unittests/ps_dnn_model.py @@ -14,9 +14,7 @@ import paddle import paddle.nn as nn -import paddle.nn.functional as F import math -import paddle.distributed.fleet as fleet class DNNLayer(nn.Layer): diff --git a/python/paddle/fluid/tests/unittests/seresnext_net.py b/python/paddle/fluid/tests/unittests/seresnext_net.py index e2233cdbe2db8c6f9dfceaed98f92711d72e9959..d1676380afefb6c6bb71c002f4c3db42b6505de9 100644 --- a/python/paddle/fluid/tests/unittests/seresnext_net.py +++ b/python/paddle/fluid/tests/unittests/seresnext_net.py @@ -17,11 +17,9 @@ import paddle.fluid as fluid fluid.core._set_eager_deletion_mode(-1, -1, False) import paddle -import paddle.fluid.layers.ops as ops from paddle.fluid.layers.learning_rate_scheduler import cosine_decay from simple_nets import init_data from seresnext_test_base import DeviceType -import math import os os.environ['CPU_NUM'] = str(4) diff --git a/python/paddle/fluid/tests/unittests/simnet_dataset_reader.py b/python/paddle/fluid/tests/unittests/simnet_dataset_reader.py index c9125bb08227a979b86b4c3dd0be57aa591fc051..5eae0ff22e14df8787d45b922ad32f0341849f83 100644 --- a/python/paddle/fluid/tests/unittests/simnet_dataset_reader.py +++ b/python/paddle/fluid/tests/unittests/simnet_dataset_reader.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import logging -import tarfile -import random - -import paddle import paddle.distributed.fleet as fleet logging.basicConfig() diff --git a/python/paddle/fluid/tests/unittests/static_model_parallel_fused_multi_transformer.py b/python/paddle/fluid/tests/unittests/static_model_parallel_fused_multi_transformer.py index 446689e085ca7472e9080e96bde929ca64822bd0..0ab441d29631620e24ad1243fbce8ca32e29f5b3 100644 --- a/python/paddle/fluid/tests/unittests/static_model_parallel_fused_multi_transformer.py +++ b/python/paddle/fluid/tests/unittests/static_model_parallel_fused_multi_transformer.py @@ -20,12 +20,6 @@ from test_dist_base import TestDistRunnerBase, runtime_main from paddle.incubate.nn import FusedMultiTransformer import paddle.distributed.fleet as fleet -from paddle.fluid.data_feeder import check_variable_and_dtype, check_dtype -from paddle.fluid.dygraph.layers import Layer -from paddle.fluid.layer_helper import LayerHelper -from paddle.fluid import core -from paddle.nn.initializer import Constant - paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/transformer_model.py b/python/paddle/fluid/tests/unittests/transformer_model.py index 4130ba7a2cc9a0951b586946b2d90601185275d4..7fd02339ec910c19d7b2e73b95a29cdaa975899a 100644 --- a/python/paddle/fluid/tests/unittests/transformer_model.py +++ b/python/paddle/fluid/tests/unittests/transformer_model.py @@ -15,7 +15,6 @@ from functools import partial import numpy as np -import os import paddle.fluid as fluid import paddle.fluid.layers as layers diff --git a/python/paddle/fluid/tests/unittests/utils.py b/python/paddle/fluid/tests/unittests/utils.py index 66376382a97245e7736ae24e02e3e8b9fa6d343f..346d40025837b915dc9c0a9f3891eda0806536e7 100644 --- a/python/paddle/fluid/tests/unittests/utils.py +++ b/python/paddle/fluid/tests/unittests/utils.py @@ -14,12 +14,7 @@ from paddle.fluid.framework import _dygraph_guard import paddle.fluid as fluid -from paddle.fluid.framework import Variable -import paddle.fluid.dygraph.jit as jit -from paddle.fluid.dygraph.jit import extract_vars import numpy as np -import os -import time __all__ = ['DyGraphProgramDescTracerTestHelper', 'is_equal_program']