From 2c407ef0ec36b146062ef38432453a522b5c6282 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Tue, 11 Oct 2022 16:42:45 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused import in unittests/test_[k-o] (#46704) --- .../fluid/tests/unittests/test_label_smooth_functional.py | 3 +-- python/paddle/fluid/tests/unittests/test_lamb_op.py | 1 - python/paddle/fluid/tests/unittests/test_lambv2_op.py | 2 -- .../paddle/fluid/tests/unittests/test_launch_coverage.py | 7 ------- .../paddle/fluid/tests/unittests/test_layer_norm_op_v2.py | 5 +---- .../paddle/fluid/tests/unittests/test_layout_autotune.py | 1 - python/paddle/fluid/tests/unittests/test_lcm.py | 2 -- .../fluid/tests/unittests/test_learning_rate_scheduler.py | 1 - python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py | 4 ---- python/paddle/fluid/tests/unittests/test_linear.py | 5 +---- python/paddle/fluid/tests/unittests/test_linspace.py | 2 +- .../fluid/tests/unittests/test_listen_and_serv_op.py | 3 --- python/paddle/fluid/tests/unittests/test_load_op.py | 1 - python/paddle/fluid/tests/unittests/test_load_op_xpu.py | 1 - .../fluid/tests/unittests/test_load_vars_shape_check.py | 2 -- python/paddle/fluid/tests/unittests/test_lod_append_op.py | 6 +----- .../fluid/tests/unittests/test_lod_array_length_op.py | 2 +- .../paddle/fluid/tests/unittests/test_logcumsumexp_op.py | 2 -- python/paddle/fluid/tests/unittests/test_logical_op.py | 1 - python/paddle/fluid/tests/unittests/test_lookahead.py | 5 +---- .../fluid/tests/unittests/test_lookup_table_dequant_op.py | 7 +------ .../fluid/tests/unittests/test_lookup_table_v2_bf16_op.py | 3 +-- python/paddle/fluid/tests/unittests/test_lr_scheduler.py | 3 --- python/paddle/fluid/tests/unittests/test_lrn_op.py | 2 +- python/paddle/fluid/tests/unittests/test_lstm_op.py | 2 +- python/paddle/fluid/tests/unittests/test_lu_op.py | 1 - python/paddle/fluid/tests/unittests/test_lu_unpack_op.py | 1 - python/paddle/fluid/tests/unittests/test_manual_seed.py | 2 -- .../fluid/tests/unittests/test_margin_cross_entropy_op.py | 3 --- python/paddle/fluid/tests/unittests/test_marker_op.py | 1 - .../paddle/fluid/tests/unittests/test_masked_select_op.py | 1 - .../fluid/tests/unittests/test_math_op_patch_var_base.py | 2 +- python/paddle/fluid/tests/unittests/test_matmul_op.py | 1 - python/paddle/fluid/tests/unittests/test_matmul_v2_op.py | 1 - .../paddle/fluid/tests/unittests/test_matrix_power_op.py | 4 ---- python/paddle/fluid/tests/unittests/test_matrix_rank_op.py | 5 +---- .../fluid/tests/unittests/test_max_min_amax_amin_op.py | 2 -- python/paddle/fluid/tests/unittests/test_max_op.py | 5 +---- python/paddle/fluid/tests/unittests/test_mean_iou.py | 1 - python/paddle/fluid/tests/unittests/test_mean_op.py | 1 - python/paddle/fluid/tests/unittests/test_memcpy_op.py | 5 +---- python/paddle/fluid/tests/unittests/test_meshgrid_op.py | 3 +-- python/paddle/fluid/tests/unittests/test_min_op.py | 5 +---- .../fluid/tests/unittests/test_mine_hard_examples_op.py | 2 -- .../tests/unittests/test_mix_precision_all_reduce_fuse.py | 3 --- python/paddle/fluid/tests/unittests/test_modelaverage.py | 3 --- python/paddle/fluid/tests/unittests/test_monitor.py | 1 - python/paddle/fluid/tests/unittests/test_mul_op.py | 1 - python/paddle/fluid/tests/unittests/test_multi_dot_op.py | 2 +- python/paddle/fluid/tests/unittests/test_multinomial_op.py | 1 - python/paddle/fluid/tests/unittests/test_multiply.py | 2 +- .../unittests/test_multiprocess_dataloader_dataset.py | 4 ++-- .../unittests/test_multiprocess_dataloader_dynamic.py | 5 +---- .../unittests/test_multiprocess_dataloader_exception.py | 6 ------ ...est_multiprocess_dataloader_iterable_dataset_dynamic.py | 5 +---- .../test_multiprocess_dataloader_iterable_dataset_split.py | 2 +- ...test_multiprocess_dataloader_iterable_dataset_static.py | 4 +--- .../tests/unittests/test_multiprocess_dataloader_static.py | 4 +--- .../tests/unittests/test_multiprocess_reader_exception.py | 2 -- python/paddle/fluid/tests/unittests/test_mv_op.py | 3 --- python/paddle/fluid/tests/unittests/test_nanmean_api.py | 2 -- python/paddle/fluid/tests/unittests/test_nansum_api.py | 2 -- .../fluid/tests/unittests/test_nearest_interp_v2_op.py | 1 - .../fluid/tests/unittests/test_network_with_dtype.py | 2 -- .../unittests/test_nn_functional_embedding_dygraph.py | 1 - .../fluid/tests/unittests/test_nn_functional_hot_op.py | 2 -- .../paddle/fluid/tests/unittests/test_nn_matmul_v2_grad.py | 1 - python/paddle/fluid/tests/unittests/test_nn_sigmoid_op.py | 2 -- python/paddle/fluid/tests/unittests/test_nonzero_api.py | 1 - python/paddle/fluid/tests/unittests/test_normalize.py | 1 - .../paddle/fluid/tests/unittests/test_number_count_op.py | 4 ---- python/paddle/fluid/tests/unittests/test_numel_op.py | 3 --- python/paddle/fluid/tests/unittests/test_one_hot_op.py | 2 -- python/paddle/fluid/tests/unittests/test_one_hot_v2_op.py | 2 -- python/paddle/fluid/tests/unittests/test_ones_like.py | 2 +- python/paddle/fluid/tests/unittests/test_ones_op.py | 3 --- python/paddle/fluid/tests/unittests/test_onnx_export.py | 5 +---- .../fluid/tests/unittests/test_op_function_generator.py | 5 ++--- python/paddle/fluid/tests/unittests/test_outer.py | 2 +- 79 files changed, 31 insertions(+), 179 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_label_smooth_functional.py b/python/paddle/fluid/tests/unittests/test_label_smooth_functional.py index 2fef18fd6b5..c5859b73116 100644 --- a/python/paddle/fluid/tests/unittests/test_label_smooth_functional.py +++ b/python/paddle/fluid/tests/unittests/test_label_smooth_functional.py @@ -14,10 +14,9 @@ import numpy as np import paddle -from paddle import fluid, nn +from paddle import fluid import paddle.fluid.dygraph as dg import paddle.nn.functional as F -import paddle.fluid.initializer as I import unittest diff --git a/python/paddle/fluid/tests/unittests/test_lamb_op.py b/python/paddle/fluid/tests/unittests/test_lamb_op.py index 03374d3d078..eaa8db70313 100644 --- a/python/paddle/fluid/tests/unittests/test_lamb_op.py +++ b/python/paddle/fluid/tests/unittests/test_lamb_op.py @@ -16,7 +16,6 @@ import unittest import numpy as np from op_test import OpTest import paddle -import paddle.fluid as fluid from paddle.fluid import core from paddle.fluid.op import Operator diff --git a/python/paddle/fluid/tests/unittests/test_lambv2_op.py b/python/paddle/fluid/tests/unittests/test_lambv2_op.py index ff18e53bb0b..1e01f3a4ce3 100644 --- a/python/paddle/fluid/tests/unittests/test_lambv2_op.py +++ b/python/paddle/fluid/tests/unittests/test_lambv2_op.py @@ -14,9 +14,7 @@ import unittest import numpy as np -from op_test import OpTest from paddle.fluid import core -from paddle.fluid.op import Operator from paddle.fluid.dygraph.base import switch_to_static_graph import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/test_launch_coverage.py b/python/paddle/fluid/tests/unittests/test_launch_coverage.py index 8f9b39b0a48..00db6590d6f 100644 --- a/python/paddle/fluid/tests/unittests/test_launch_coverage.py +++ b/python/paddle/fluid/tests/unittests/test_launch_coverage.py @@ -12,14 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import subprocess -import os -import time -import six -import copy import unittest -import paddle.fluid as fluid from argparse import ArgumentParser, REMAINDER from paddle.distributed.utils.launch_utils import _print_arguments, get_gpus, get_cluster_from_args diff --git a/python/paddle/fluid/tests/unittests/test_layer_norm_op_v2.py b/python/paddle/fluid/tests/unittests/test_layer_norm_op_v2.py index 62a0f00eba3..8d6dfab7199 100644 --- a/python/paddle/fluid/tests/unittests/test_layer_norm_op_v2.py +++ b/python/paddle/fluid/tests/unittests/test_layer_norm_op_v2.py @@ -12,14 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import unittest import numpy as np import paddle.fluid.core as core -from paddle.fluid.op import Operator import paddle.fluid as fluid -from op_test import OpTest, _set_use_system_allocator -from paddle.fluid.framework import grad_var_name, _test_eager_guard +from paddle.fluid.framework import _test_eager_guard import paddle.fluid as fluid from paddle.fluid import Program, program_guard import paddle diff --git a/python/paddle/fluid/tests/unittests/test_layout_autotune.py b/python/paddle/fluid/tests/unittests/test_layout_autotune.py index 497bcd89e17..e004850587f 100644 --- a/python/paddle/fluid/tests/unittests/test_layout_autotune.py +++ b/python/paddle/fluid/tests/unittests/test_layout_autotune.py @@ -17,7 +17,6 @@ import json import tempfile import unittest import warnings -import numpy import paddle import paddle.nn.functional as F diff --git a/python/paddle/fluid/tests/unittests/test_lcm.py b/python/paddle/fluid/tests/unittests/test_lcm.py index d03e9f5998f..6f113c13a01 100644 --- a/python/paddle/fluid/tests/unittests/test_lcm.py +++ b/python/paddle/fluid/tests/unittests/test_lcm.py @@ -17,8 +17,6 @@ import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid import Program, program_guard -from op_test import OpTest paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/test_learning_rate_scheduler.py b/python/paddle/fluid/tests/unittests/test_learning_rate_scheduler.py index 5ea1a7638c5..bd73f628a02 100644 --- a/python/paddle/fluid/tests/unittests/test_learning_rate_scheduler.py +++ b/python/paddle/fluid/tests/unittests/test_learning_rate_scheduler.py @@ -17,7 +17,6 @@ import math import numpy as np import unittest -import paddle import paddle.fluid as fluid import paddle.fluid.layers as layers import paddle.fluid.framework as framework diff --git a/python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py b/python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py index 247e3861c37..03e671d8832 100644 --- a/python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py +++ b/python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py @@ -16,11 +16,7 @@ import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.core as core -from op_test import OpTest, skip_check_grad_ci -from gradient_checker import grad_check -from decorator_helper import prog_scope class LinalgPinvTestCase(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_linear.py b/python/paddle/fluid/tests/unittests/test_linear.py index 65cc224eed5..eaf2cb528cc 100644 --- a/python/paddle/fluid/tests/unittests/test_linear.py +++ b/python/paddle/fluid/tests/unittests/test_linear.py @@ -15,12 +15,9 @@ import unittest import numpy as np import paddle.fluid.core as core -from op_test import OpTest import paddle -from paddle import fluid, nn -import paddle.fluid.dygraph as dg +from paddle import fluid import paddle.nn.functional as F -import paddle.fluid.initializer as I class LinearTestCase(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_linspace.py b/python/paddle/fluid/tests/unittests/test_linspace.py index c1358135153..c38d5b1fe59 100644 --- a/python/paddle/fluid/tests/unittests/test_linspace.py +++ b/python/paddle/fluid/tests/unittests/test_linspace.py @@ -17,7 +17,7 @@ import numpy as np from op_test import OpTest import paddle import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard from paddle.fluid import core from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py b/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py index 62bf274a4e4..62e063179fa 100644 --- a/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py +++ b/python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py @@ -19,12 +19,9 @@ silentremove("test_list_and_serv_run_empty_optimize_block.flag") import paddle import paddle.fluid as fluid -import signal -import subprocess import time import unittest from multiprocessing import Process -from op_test import OpTest paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/test_load_op.py b/python/paddle/fluid/tests/unittests/test_load_op.py index 534c6d832e6..1b81f3b8f40 100644 --- a/python/paddle/fluid/tests/unittests/test_load_op.py +++ b/python/paddle/fluid/tests/unittests/test_load_op.py @@ -14,7 +14,6 @@ import unittest import numpy as np -from op_test import OpTest, randomize_probability import paddle.fluid as fluid import paddle.fluid.layers as layers import os diff --git a/python/paddle/fluid/tests/unittests/test_load_op_xpu.py b/python/paddle/fluid/tests/unittests/test_load_op_xpu.py index 0ec944aba93..957fe5aa420 100644 --- a/python/paddle/fluid/tests/unittests/test_load_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/test_load_op_xpu.py @@ -16,7 +16,6 @@ import unittest import numpy as np import os import tempfile -from op_test import OpTest, randomize_probability import paddle.fluid as fluid import paddle.fluid.layers as layers import paddle diff --git a/python/paddle/fluid/tests/unittests/test_load_vars_shape_check.py b/python/paddle/fluid/tests/unittests/test_load_vars_shape_check.py index 566c4929bf7..2d9bd1ac650 100644 --- a/python/paddle/fluid/tests/unittests/test_load_vars_shape_check.py +++ b/python/paddle/fluid/tests/unittests/test_load_vars_shape_check.py @@ -15,8 +15,6 @@ import unittest import os import shutil -import numpy as np -import paddle as paddle import paddle.fluid as fluid from paddle.fluid.executor import Executor diff --git a/python/paddle/fluid/tests/unittests/test_lod_append_op.py b/python/paddle/fluid/tests/unittests/test_lod_append_op.py index 7a7d76eee73..23d828b3cd7 100644 --- a/python/paddle/fluid/tests/unittests/test_lod_append_op.py +++ b/python/paddle/fluid/tests/unittests/test_lod_append_op.py @@ -15,11 +15,7 @@ import unittest import numpy as np import paddle.fluid as fluid -import paddle.fluid.layers as layers -import paddle.fluid.core as core -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid.op import Operator -from paddle.fluid.backward import append_backward +from paddle.fluid import Program class TestLoDAppendAPI(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_lod_array_length_op.py b/python/paddle/fluid/tests/unittests/test_lod_array_length_op.py index 67f7ee93c6e..4129c59edca 100644 --- a/python/paddle/fluid/tests/unittests/test_lod_array_length_op.py +++ b/python/paddle/fluid/tests/unittests/test_lod_array_length_op.py @@ -19,7 +19,7 @@ import paddle.fluid.layers as layers from paddle.fluid.executor import Executor import paddle.fluid.core as core import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard import numpy diff --git a/python/paddle/fluid/tests/unittests/test_logcumsumexp_op.py b/python/paddle/fluid/tests/unittests/test_logcumsumexp_op.py index 55ffbe52a72..566b65624e5 100644 --- a/python/paddle/fluid/tests/unittests/test_logcumsumexp_op.py +++ b/python/paddle/fluid/tests/unittests/test_logcumsumexp_op.py @@ -19,8 +19,6 @@ import numpy as np import paddle import paddle.fluid.core as core import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid.framework import _test_eager_guard from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_logical_op.py b/python/paddle/fluid/tests/unittests/test_logical_op.py index e9600ce8a78..c36445e7b07 100755 --- a/python/paddle/fluid/tests/unittests/test_logical_op.py +++ b/python/paddle/fluid/tests/unittests/test_logical_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import op_test import unittest import numpy as np import paddle diff --git a/python/paddle/fluid/tests/unittests/test_lookahead.py b/python/paddle/fluid/tests/unittests/test_lookahead.py index 2e2024c1c40..10c2ef78b86 100644 --- a/python/paddle/fluid/tests/unittests/test_lookahead.py +++ b/python/paddle/fluid/tests/unittests/test_lookahead.py @@ -14,13 +14,10 @@ import unittest import numpy as np -from op_test import OpTest -from paddle.fluid import core -from paddle.fluid.op import Operator import paddle.fluid as fluid import paddle import paddle.nn as nn -from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph +from paddle.fluid.framework import _test_eager_guard LOOKAHEAD_K = 5 LOOKAHEAD_ALPHA = 0.2 diff --git a/python/paddle/fluid/tests/unittests/test_lookup_table_dequant_op.py b/python/paddle/fluid/tests/unittests/test_lookup_table_dequant_op.py index e04565a4c3a..bd15a3ac1cb 100644 --- a/python/paddle/fluid/tests/unittests/test_lookup_table_dequant_op.py +++ b/python/paddle/fluid/tests/unittests/test_lookup_table_dequant_op.py @@ -14,12 +14,7 @@ import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci -import paddle.fluid.core as core -from paddle.fluid.op import Operator -import paddle.compat as cpt -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard +from op_test import OpTest import struct diff --git a/python/paddle/fluid/tests/unittests/test_lookup_table_v2_bf16_op.py b/python/paddle/fluid/tests/unittests/test_lookup_table_v2_bf16_op.py index 9509889f0bb..a479693d518 100644 --- a/python/paddle/fluid/tests/unittests/test_lookup_table_v2_bf16_op.py +++ b/python/paddle/fluid/tests/unittests/test_lookup_table_v2_bf16_op.py @@ -15,8 +15,7 @@ import unittest import numpy as np import paddle -from paddle.fluid.tests.unittests.op_test import (skip_check_grad_ci, - convert_uint16_to_float) +from paddle.fluid.tests.unittests.op_test import convert_uint16_to_float from paddle.fluid.tests.unittests.test_lookup_table_bf16_op import ( _lookup, TestLookupTableBF16Op, TestLookupTableBF16OpIds4D, TestLookupTableBF16OpWIsSelectedRows, diff --git a/python/paddle/fluid/tests/unittests/test_lr_scheduler.py b/python/paddle/fluid/tests/unittests/test_lr_scheduler.py index d4dac6143d4..2d76f141f9f 100644 --- a/python/paddle/fluid/tests/unittests/test_lr_scheduler.py +++ b/python/paddle/fluid/tests/unittests/test_lr_scheduler.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy import math import numpy as np import unittest import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers -import paddle.fluid.framework as framework import paddle.fluid.core as core diff --git a/python/paddle/fluid/tests/unittests/test_lrn_op.py b/python/paddle/fluid/tests/unittests/test_lrn_op.py index 96d76fcee23..c87d3067cc4 100644 --- a/python/paddle/fluid/tests/unittests/test_lrn_op.py +++ b/python/paddle/fluid/tests/unittests/test_lrn_op.py @@ -18,7 +18,7 @@ import numpy as np import paddle.fluid as fluid import paddle.fluid.core as core from op_test import OpTest -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard class TestLRNOp(OpTest): diff --git a/python/paddle/fluid/tests/unittests/test_lstm_op.py b/python/paddle/fluid/tests/unittests/test_lstm_op.py index 4d12b4311df..db701a7b733 100644 --- a/python/paddle/fluid/tests/unittests/test_lstm_op.py +++ b/python/paddle/fluid/tests/unittests/test_lstm_op.py @@ -14,7 +14,7 @@ import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci +from op_test import OpTest from paddle import fluid from paddle.fluid.layers import lstm as LSTM from paddle.fluid.layers import fill_constant diff --git a/python/paddle/fluid/tests/unittests/test_lu_op.py b/python/paddle/fluid/tests/unittests/test_lu_op.py index 43ad2a027ee..0c24bcd6865 100644 --- a/python/paddle/fluid/tests/unittests/test_lu_op.py +++ b/python/paddle/fluid/tests/unittests/test_lu_op.py @@ -18,7 +18,6 @@ import itertools import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.core as core import scipy import scipy.linalg diff --git a/python/paddle/fluid/tests/unittests/test_lu_unpack_op.py b/python/paddle/fluid/tests/unittests/test_lu_unpack_op.py index fad97b21975..1ec36680fa4 100644 --- a/python/paddle/fluid/tests/unittests/test_lu_unpack_op.py +++ b/python/paddle/fluid/tests/unittests/test_lu_unpack_op.py @@ -18,7 +18,6 @@ import itertools import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.core as core import scipy import scipy.linalg diff --git a/python/paddle/fluid/tests/unittests/test_manual_seed.py b/python/paddle/fluid/tests/unittests/test_manual_seed.py index 7ef2cee14a9..7d9762c788a 100644 --- a/python/paddle/fluid/tests/unittests/test_manual_seed.py +++ b/python/paddle/fluid/tests/unittests/test_manual_seed.py @@ -16,8 +16,6 @@ import unittest import paddle import paddle.fluid as fluid -from paddle.framework import seed -from paddle.fluid.framework import Program, default_main_program, default_startup_program import numpy as np diff --git a/python/paddle/fluid/tests/unittests/test_margin_cross_entropy_op.py b/python/paddle/fluid/tests/unittests/test_margin_cross_entropy_op.py index 746a01039c9..6473ab7568f 100644 --- a/python/paddle/fluid/tests/unittests/test_margin_cross_entropy_op.py +++ b/python/paddle/fluid/tests/unittests/test_margin_cross_entropy_op.py @@ -15,10 +15,7 @@ import unittest import numpy as np from op_test import OpTest -import math -import random import paddle -import paddle.fluid as fluid from paddle.fluid import core from paddle.fluid import Program, program_guard diff --git a/python/paddle/fluid/tests/unittests/test_marker_op.py b/python/paddle/fluid/tests/unittests/test_marker_op.py index cdf132b72b1..f0cb6ec1bbb 100644 --- a/python/paddle/fluid/tests/unittests/test_marker_op.py +++ b/python/paddle/fluid/tests/unittests/test_marker_op.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 from op_test import OpTest from paddle.distributed.fleet.meta_optimizers.common import OpRole diff --git a/python/paddle/fluid/tests/unittests/test_masked_select_op.py b/python/paddle/fluid/tests/unittests/test_masked_select_op.py index 80b2e28f947..4de07192dd0 100644 --- a/python/paddle/fluid/tests/unittests/test_masked_select_op.py +++ b/python/paddle/fluid/tests/unittests/test_masked_select_op.py @@ -15,7 +15,6 @@ import unittest import numpy as np from op_test import OpTest -import paddle.fluid as fluid import paddle diff --git a/python/paddle/fluid/tests/unittests/test_math_op_patch_var_base.py b/python/paddle/fluid/tests/unittests/test_math_op_patch_var_base.py index 05e774451b8..5c66d4cd6b5 100644 --- a/python/paddle/fluid/tests/unittests/test_math_op_patch_var_base.py +++ b/python/paddle/fluid/tests/unittests/test_math_op_patch_var_base.py @@ -17,7 +17,7 @@ import paddle import paddle.fluid as fluid import numpy as np import inspect -from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph +from paddle.fluid.framework import _test_eager_guard class TestMathOpPatchesVarBase(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_matmul_op.py b/python/paddle/fluid/tests/unittests/test_matmul_op.py index 4401c6ef812..b8ca9b9dc1a 100644 --- a/python/paddle/fluid/tests/unittests/test_matmul_op.py +++ b/python/paddle/fluid/tests/unittests/test_matmul_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle.fluid.core as core import unittest import numpy as np from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_matmul_v2_op.py b/python/paddle/fluid/tests/unittests/test_matmul_v2_op.py index 7a2f75400be..4caffe5019f 100644 --- a/python/paddle/fluid/tests/unittests/test_matmul_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_matmul_v2_op.py @@ -20,7 +20,6 @@ import paddle.fluid.core as core import paddle import paddle.fluid as fluid -import paddle.fluid.framework as framework from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_matrix_power_op.py b/python/paddle/fluid/tests/unittests/test_matrix_power_op.py index 92ce97d8821..af400b14615 100644 --- a/python/paddle/fluid/tests/unittests/test_matrix_power_op.py +++ b/python/paddle/fluid/tests/unittests/test_matrix_power_op.py @@ -359,10 +359,8 @@ class TestMatrixPowerSingularAPI(unittest.TestCase): fetch_list=[result]) except RuntimeError as ex: print("The mat is singular") - pass except ValueError as ex: print("The mat is singular") - pass def test_static(self): paddle.enable_static() @@ -379,10 +377,8 @@ class TestMatrixPowerSingularAPI(unittest.TestCase): result = paddle.linalg.matrix_power(input, -2) except RuntimeError as ex: print("The mat is singular") - pass except ValueError as ex: print("The mat is singular") - pass if __name__ == "__main__": diff --git a/python/paddle/fluid/tests/unittests/test_matrix_rank_op.py b/python/paddle/fluid/tests/unittests/test_matrix_rank_op.py index 316079a8650..3c3dba88004 100644 --- a/python/paddle/fluid/tests/unittests/test_matrix_rank_op.py +++ b/python/paddle/fluid/tests/unittests/test_matrix_rank_op.py @@ -16,13 +16,10 @@ import unittest import numpy as np -from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16 +from paddle.fluid.tests.unittests.op_test import OpTest import paddle -import paddle.nn as nn -import paddle.nn.functional as F import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid import compiler, Program, program_guard paddle.enable_static() SEED = 2049 diff --git a/python/paddle/fluid/tests/unittests/test_max_min_amax_amin_op.py b/python/paddle/fluid/tests/unittests/test_max_min_amax_amin_op.py index f7509ba1c8b..ee316bb0431 100644 --- a/python/paddle/fluid/tests/unittests/test_max_min_amax_amin_op.py +++ b/python/paddle/fluid/tests/unittests/test_max_min_amax_amin_op.py @@ -17,8 +17,6 @@ import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid import Program, program_guard -from op_test import OpTest paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/test_max_op.py b/python/paddle/fluid/tests/unittests/test_max_op.py index 844374b641b..cf52cdb8d47 100644 --- a/python/paddle/fluid/tests/unittests/test_max_op.py +++ b/python/paddle/fluid/tests/unittests/test_max_op.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import unittest -import tempfile import numpy as np -from op_test import OpTest, skip_check_grad_ci, check_out_dtype +from op_test import check_out_dtype import paddle from paddle.fluid.framework import _test_eager_guard import paddle.fluid.core as core -import paddle.inference as paddle_infer from test_sum_op import TestReduceOPTensorAxisBase diff --git a/python/paddle/fluid/tests/unittests/test_mean_iou.py b/python/paddle/fluid/tests/unittests/test_mean_iou.py index e334d881c8b..d55d1507f96 100644 --- a/python/paddle/fluid/tests/unittests/test_mean_iou.py +++ b/python/paddle/fluid/tests/unittests/test_mean_iou.py @@ -16,7 +16,6 @@ import unittest import numpy as np from op_test import OpTest import paddle.fluid as fluid -import paddle def compute_mean_iou(predictions, labels, num_classes, in_wrongs, in_corrects, diff --git a/python/paddle/fluid/tests/unittests/test_mean_op.py b/python/paddle/fluid/tests/unittests/test_mean_op.py index f7ca51dbd69..6ba980879a6 100644 --- a/python/paddle/fluid/tests/unittests/test_mean_op.py +++ b/python/paddle/fluid/tests/unittests/test_mean_op.py @@ -19,7 +19,6 @@ import paddle import paddle.fluid.core as core import paddle.fluid as fluid from paddle.fluid import Program, program_guard -from paddle.fluid.framework import _test_eager_guard from test_sum_op import TestReduceOPTensorAxisBase import gradient_checker from decorator_helper import prog_scope diff --git a/python/paddle/fluid/tests/unittests/test_memcpy_op.py b/python/paddle/fluid/tests/unittests/test_memcpy_op.py index 9288cbda2bc..8ab07ad9583 100755 --- a/python/paddle/fluid/tests/unittests/test_memcpy_op.py +++ b/python/paddle/fluid/tests/unittests/test_memcpy_op.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import op_test import numpy as np import unittest import paddle import paddle.fluid.core as core -from paddle.fluid.op import Operator import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid.backward import append_backward +from paddle.fluid import Program, program_guard class TestMemcpy_FillConstant(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_meshgrid_op.py b/python/paddle/fluid/tests/unittests/test_meshgrid_op.py index df8a85792e0..f49ac0d1d52 100644 --- a/python/paddle/fluid/tests/unittests/test_meshgrid_op.py +++ b/python/paddle/fluid/tests/unittests/test_meshgrid_op.py @@ -14,10 +14,9 @@ import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci +from op_test import OpTest import paddle.fluid as fluid import paddle -from paddle.fluid import compiler, Program, program_guard, core from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_min_op.py b/python/paddle/fluid/tests/unittests/test_min_op.py index b2554040984..1f4cd926241 100644 --- a/python/paddle/fluid/tests/unittests/test_min_op.py +++ b/python/paddle/fluid/tests/unittests/test_min_op.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import unittest -import tempfile import numpy as np -from op_test import OpTest, skip_check_grad_ci, check_out_dtype +from op_test import check_out_dtype import paddle import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard -import paddle.inference as paddle_infer from test_sum_op import TestReduceOPTensorAxisBase diff --git a/python/paddle/fluid/tests/unittests/test_mine_hard_examples_op.py b/python/paddle/fluid/tests/unittests/test_mine_hard_examples_op.py index 0e9e8f084c3..67329652726 100644 --- a/python/paddle/fluid/tests/unittests/test_mine_hard_examples_op.py +++ b/python/paddle/fluid/tests/unittests/test_mine_hard_examples_op.py @@ -14,8 +14,6 @@ import unittest import numpy as np -import sys -import math from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_mix_precision_all_reduce_fuse.py b/python/paddle/fluid/tests/unittests/test_mix_precision_all_reduce_fuse.py index be3ac17f66c..bc57d38b77c 100644 --- a/python/paddle/fluid/tests/unittests/test_mix_precision_all_reduce_fuse.py +++ b/python/paddle/fluid/tests/unittests/test_mix_precision_all_reduce_fuse.py @@ -13,9 +13,6 @@ # limitations under the License. import paddle.fluid.core as core -import math -import os -import sys import unittest import numpy as np diff --git a/python/paddle/fluid/tests/unittests/test_modelaverage.py b/python/paddle/fluid/tests/unittests/test_modelaverage.py index 86beb42a563..474fa692b47 100644 --- a/python/paddle/fluid/tests/unittests/test_modelaverage.py +++ b/python/paddle/fluid/tests/unittests/test_modelaverage.py @@ -14,9 +14,6 @@ import unittest import numpy as np -from op_test import OpTest -from paddle.fluid import core -from paddle.fluid.op import Operator import paddle.fluid as fluid import paddle import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/test_monitor.py b/python/paddle/fluid/tests/unittests/test_monitor.py index 2eecacc5fa0..8649f11821e 100644 --- a/python/paddle/fluid/tests/unittests/test_monitor.py +++ b/python/paddle/fluid/tests/unittests/test_monitor.py @@ -21,7 +21,6 @@ paddle.enable_static() import paddle.fluid as fluid import paddle.fluid.core as core -import numpy as np import os import unittest import tempfile diff --git a/python/paddle/fluid/tests/unittests/test_mul_op.py b/python/paddle/fluid/tests/unittests/test_mul_op.py index 892e0dd98e3..0236f34ea8b 100644 --- a/python/paddle/fluid/tests/unittests/test_mul_op.py +++ b/python/paddle/fluid/tests/unittests/test_mul_op.py @@ -14,7 +14,6 @@ import unittest import numpy as np -import paddle import paddle.fluid.core as core import sys diff --git a/python/paddle/fluid/tests/unittests/test_multi_dot_op.py b/python/paddle/fluid/tests/unittests/test_multi_dot_op.py index 8e58aeb2c1e..ce188cac5c7 100644 --- a/python/paddle/fluid/tests/unittests/test_multi_dot_op.py +++ b/python/paddle/fluid/tests/unittests/test_multi_dot_op.py @@ -14,7 +14,7 @@ import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci +from op_test import OpTest from numpy.linalg import multi_dot from op_test import OpTest import paddle diff --git a/python/paddle/fluid/tests/unittests/test_multinomial_op.py b/python/paddle/fluid/tests/unittests/test_multinomial_op.py index 71e6cca2907..5df70185dda 100644 --- a/python/paddle/fluid/tests/unittests/test_multinomial_op.py +++ b/python/paddle/fluid/tests/unittests/test_multinomial_op.py @@ -15,7 +15,6 @@ import unittest import paddle import paddle.fluid as fluid -from paddle.fluid import core from op_test import OpTest import numpy as np import os diff --git a/python/paddle/fluid/tests/unittests/test_multiply.py b/python/paddle/fluid/tests/unittests/test_multiply.py index 55d17f71567..e32245990a8 100755 --- a/python/paddle/fluid/tests/unittests/test_multiply.py +++ b/python/paddle/fluid/tests/unittests/test_multiply.py @@ -19,7 +19,7 @@ import numpy as np import paddle import paddle.tensor as tensor from paddle.static import Program, program_guard -from paddle.fluid.framework import _test_eager_guard, in_dygraph_mode +from paddle.fluid.framework import _test_eager_guard class TestMultiplyApi(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dataset.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dataset.py index 1ecddc6268c..4cf28bbd30b 100755 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dataset.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dataset.py @@ -18,8 +18,8 @@ import numpy as np import paddle import paddle.fluid as fluid from paddle.io import Dataset, IterableDataset, TensorDataset, \ - ComposeDataset, ChainDataset, DataLoader, random_split, Subset -from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph + ComposeDataset, ChainDataset, DataLoader +from paddle.fluid.framework import _test_eager_guard IMAGE_SIZE = 32 diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py index 419e769b933..32e56277366 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import sys import six import time import unittest -import multiprocessing import numpy as np import paddle.fluid as fluid -from paddle.io import Dataset, BatchSampler, DataLoader +from paddle.io import DataLoader from paddle.fluid.dygraph.nn import Linear -from paddle.fluid.dygraph.base import to_variable from test_multiprocess_dataloader_static import RandomDataset, RandomBatchedDataset, prepare_places from test_multiprocess_dataloader_static import EPOCH_NUM, BATCH_SIZE, IMAGE_SIZE, SAMPLE_NUM, CLASS_NUM diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py index 096c6ce542f..ea4b9363bfc 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys -import six -import time import unittest import multiprocessing import numpy as np @@ -23,8 +19,6 @@ import numpy as np import paddle.fluid as fluid import paddle.fluid.core as core from paddle.io import Dataset, IterableDataset, BatchSampler, DataLoader -from paddle.fluid.dygraph.nn import Linear -from paddle.fluid.dygraph.base import to_variable from paddle.fluid.dataloader.dataloader_iter import _worker_loop diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py index 4ca1480c639..09a1f6520ab 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import sys import six import time import unittest -import multiprocessing import numpy as np import paddle.fluid as fluid -from paddle.io import Dataset, BatchSampler, DataLoader +from paddle.io import DataLoader from paddle.fluid.dygraph.nn import Linear -from paddle.fluid.dygraph.base import to_variable from test_multiprocess_dataloader_iterable_dataset_static import RandomDataset, RandomBatchedDataset, prepare_places from test_multiprocess_dataloader_iterable_dataset_static import EPOCH_NUM, BATCH_SIZE, IMAGE_SIZE, SAMPLE_NUM, CLASS_NUM diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_split.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_split.py index bf7a7bdd5d5..aef0c8c7d08 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_split.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_split.py @@ -17,7 +17,7 @@ import unittest import numpy as np import paddle.fluid as fluid -from paddle.io import IterableDataset, BatchSampler, DataLoader, get_worker_info +from paddle.io import DataLoader, IterableDataset, get_worker_info class RangeIterableDatasetSplit(IterableDataset): diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_static.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_static.py index 74fb23d84b6..b84530ccc41 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_static.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_static.py @@ -12,16 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import sys import six import time import unittest -import multiprocessing import numpy as np import paddle.fluid as fluid -from paddle.io import IterableDataset, BatchSampler, DataLoader, get_worker_info +from paddle.io import DataLoader, IterableDataset EPOCH_NUM = 2 BATCH_SIZE = 8 diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_static.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_static.py index d5706ab618d..dc9444f2f5f 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_static.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_static.py @@ -12,17 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import sys import six import time import unittest -import multiprocessing import numpy as np import paddle import paddle.fluid as fluid -from paddle.io import Dataset, BatchSampler, DataLoader +from paddle.io import DataLoader, Dataset EPOCH_NUM = 3 BATCH_SIZE = 8 diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_reader_exception.py b/python/paddle/fluid/tests/unittests/test_multiprocess_reader_exception.py index 825a6b8fa49..e1033ae881e 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_reader_exception.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_reader_exception.py @@ -17,8 +17,6 @@ import paddle.fluid as fluid from paddle.reader import multiprocess_reader import unittest import numpy as np -import six -import sys class ReaderException(Exception): diff --git a/python/paddle/fluid/tests/unittests/test_mv_op.py b/python/paddle/fluid/tests/unittests/test_mv_op.py index 31ef652c3c4..fbfd18a4778 100644 --- a/python/paddle/fluid/tests/unittests/test_mv_op.py +++ b/python/paddle/fluid/tests/unittests/test_mv_op.py @@ -15,9 +15,6 @@ import unittest import numpy as np import paddle -import paddle.fluid as fluid -import paddle.fluid.layers as layers -import paddle.fluid.core as core from paddle.static import program_guard, Program from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_nanmean_api.py b/python/paddle/fluid/tests/unittests/test_nanmean_api.py index 60a77b47c48..3155140518d 100644 --- a/python/paddle/fluid/tests/unittests/test_nanmean_api.py +++ b/python/paddle/fluid/tests/unittests/test_nanmean_api.py @@ -15,9 +15,7 @@ import unittest import numpy as np import paddle -import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid import Program, program_guard np.random.seed(10) diff --git a/python/paddle/fluid/tests/unittests/test_nansum_api.py b/python/paddle/fluid/tests/unittests/test_nansum_api.py index fc692960213..c0fe5da0cbc 100644 --- a/python/paddle/fluid/tests/unittests/test_nansum_api.py +++ b/python/paddle/fluid/tests/unittests/test_nansum_api.py @@ -16,8 +16,6 @@ import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.core as core -from paddle.fluid import Program, program_guard class API_Test_Nansum(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py index f8fbca45169..c3157a6e9a1 100755 --- a/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py @@ -17,7 +17,6 @@ import numpy as np from op_test import OpTest import paddle.fluid.core as core import paddle.fluid as fluid -import paddle.nn as nn import paddle from paddle.nn.functional import interpolate diff --git a/python/paddle/fluid/tests/unittests/test_network_with_dtype.py b/python/paddle/fluid/tests/unittests/test_network_with_dtype.py index f4015e22518..203dcdc38cb 100644 --- a/python/paddle/fluid/tests/unittests/test_network_with_dtype.py +++ b/python/paddle/fluid/tests/unittests/test_network_with_dtype.py @@ -14,11 +14,9 @@ import unittest -import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.executor import Executor BATCH_SIZE = 20 diff --git a/python/paddle/fluid/tests/unittests/test_nn_functional_embedding_dygraph.py b/python/paddle/fluid/tests/unittests/test_nn_functional_embedding_dygraph.py index 128d50f1554..d658fcec836 100644 --- a/python/paddle/fluid/tests/unittests/test_nn_functional_embedding_dygraph.py +++ b/python/paddle/fluid/tests/unittests/test_nn_functional_embedding_dygraph.py @@ -15,7 +15,6 @@ import unittest import paddle -import paddle.nn as nn import numpy as np from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_nn_functional_hot_op.py b/python/paddle/fluid/tests/unittests/test_nn_functional_hot_op.py index e8adf3850a8..27a7af94485 100644 --- a/python/paddle/fluid/tests/unittests/test_nn_functional_hot_op.py +++ b/python/paddle/fluid/tests/unittests/test_nn_functional_hot_op.py @@ -14,13 +14,11 @@ import unittest import numpy as np -import math from op_test import OpTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core import paddle.nn.functional as functional -import paddle.fluid.framework as framework from paddle.fluid.framework import Program, program_guard diff --git a/python/paddle/fluid/tests/unittests/test_nn_matmul_v2_grad.py b/python/paddle/fluid/tests/unittests/test_nn_matmul_v2_grad.py index f8542c00398..567ac1404c6 100644 --- a/python/paddle/fluid/tests/unittests/test_nn_matmul_v2_grad.py +++ b/python/paddle/fluid/tests/unittests/test_nn_matmul_v2_grad.py @@ -17,7 +17,6 @@ import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.core as core import gradient_checker from decorator_helper import prog_scope diff --git a/python/paddle/fluid/tests/unittests/test_nn_sigmoid_op.py b/python/paddle/fluid/tests/unittests/test_nn_sigmoid_op.py index f71a6c6afc6..7af7b96c999 100644 --- a/python/paddle/fluid/tests/unittests/test_nn_sigmoid_op.py +++ b/python/paddle/fluid/tests/unittests/test_nn_sigmoid_op.py @@ -16,8 +16,6 @@ import unittest import numpy as np import paddle import paddle.fluid.core as core -from op_test import OpTest -from scipy.special import expit, erf import paddle import paddle.fluid as fluid import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/test_nonzero_api.py b/python/paddle/fluid/tests/unittests/test_nonzero_api.py index a3c79600941..cd4d227e823 100644 --- a/python/paddle/fluid/tests/unittests/test_nonzero_api.py +++ b/python/paddle/fluid/tests/unittests/test_nonzero_api.py @@ -14,7 +14,6 @@ import unittest import numpy as np -from op_test import OpTest import paddle import paddle.fluid as fluid from paddle.fluid import Program, program_guard diff --git a/python/paddle/fluid/tests/unittests/test_normalize.py b/python/paddle/fluid/tests/unittests/test_normalize.py index ad8fdebfbb7..bb8b4881d3f 100644 --- a/python/paddle/fluid/tests/unittests/test_normalize.py +++ b/python/paddle/fluid/tests/unittests/test_normalize.py @@ -16,7 +16,6 @@ import unittest import paddle import paddle.nn.functional as F import paddle.fluid as fluid -import paddle.fluid.core as core import numpy as np from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_number_count_op.py b/python/paddle/fluid/tests/unittests/test_number_count_op.py index 5fc82a97685..58e24e6692a 100644 --- a/python/paddle/fluid/tests/unittests/test_number_count_op.py +++ b/python/paddle/fluid/tests/unittests/test_number_count_op.py @@ -17,10 +17,6 @@ import numpy as np import unittest import paddle import paddle.fluid.core as core -from paddle.fluid.op import Operator -import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid.backward import append_backward from paddle.distributed.models.moe import utils from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_numel_op.py b/python/paddle/fluid/tests/unittests/test_numel_op.py index 2bdb8dde5a9..7bb76c531a3 100644 --- a/python/paddle/fluid/tests/unittests/test_numel_op.py +++ b/python/paddle/fluid/tests/unittests/test_numel_op.py @@ -15,10 +15,7 @@ import unittest import numpy as np from op_test import OpTest -import paddle.fluid.core as core import paddle.fluid as fluid -from paddle.fluid import Program, program_guard -import functools import paddle diff --git a/python/paddle/fluid/tests/unittests/test_one_hot_op.py b/python/paddle/fluid/tests/unittests/test_one_hot_op.py index de6a4c051ea..55abf26ea23 100644 --- a/python/paddle/fluid/tests/unittests/test_one_hot_op.py +++ b/python/paddle/fluid/tests/unittests/test_one_hot_op.py @@ -14,12 +14,10 @@ import unittest import numpy as np -import math from op_test import OpTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core -import paddle.fluid.framework as framework from paddle.fluid.framework import Program, program_guard diff --git a/python/paddle/fluid/tests/unittests/test_one_hot_v2_op.py b/python/paddle/fluid/tests/unittests/test_one_hot_v2_op.py index d10db304980..284957a5318 100644 --- a/python/paddle/fluid/tests/unittests/test_one_hot_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_one_hot_v2_op.py @@ -14,12 +14,10 @@ import unittest import numpy as np -import math from op_test import OpTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core -import paddle.fluid.framework as framework from paddle.fluid.framework import Program, program_guard, _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_ones_like.py b/python/paddle/fluid/tests/unittests/test_ones_like.py index f8ad66fc0f1..8c0ceadbf58 100644 --- a/python/paddle/fluid/tests/unittests/test_ones_like.py +++ b/python/paddle/fluid/tests/unittests/test_ones_like.py @@ -16,7 +16,7 @@ import unittest import numpy as np import paddle import paddle.fluid as fluid -from paddle import _C_ops, _legacy_C_ops +from paddle import _C_ops from paddle import ones_like from paddle.fluid import core, Program, program_guard from paddle.fluid.framework import convert_np_dtype_to_dtype_ diff --git a/python/paddle/fluid/tests/unittests/test_ones_op.py b/python/paddle/fluid/tests/unittests/test_ones_op.py index 79ca0648c94..ac02627f9cc 100644 --- a/python/paddle/fluid/tests/unittests/test_ones_op.py +++ b/python/paddle/fluid/tests/unittests/test_ones_op.py @@ -14,11 +14,8 @@ import unittest import numpy as np -from op_test import OpTest import paddle -import paddle.fluid.core as core -from paddle.fluid.op import Operator import paddle.fluid as fluid import numpy as np diff --git a/python/paddle/fluid/tests/unittests/test_onnx_export.py b/python/paddle/fluid/tests/unittests/test_onnx_export.py index cac464dc077..6cb4ed2fd92 100644 --- a/python/paddle/fluid/tests/unittests/test_onnx_export.py +++ b/python/paddle/fluid/tests/unittests/test_onnx_export.py @@ -12,14 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import pickle import unittest import numpy as np import paddle -from paddle.static import InputSpec -from paddle.fluid.framework import in_dygraph_mode, _test_eager_guard +from paddle.fluid.framework import _test_eager_guard class LinearNet(paddle.nn.Layer): diff --git a/python/paddle/fluid/tests/unittests/test_op_function_generator.py b/python/paddle/fluid/tests/unittests/test_op_function_generator.py index 441e77b455c..a8e4e7d3e82 100644 --- a/python/paddle/fluid/tests/unittests/test_op_function_generator.py +++ b/python/paddle/fluid/tests/unittests/test_op_function_generator.py @@ -13,13 +13,12 @@ # limitations under the License. import unittest -from paddle.fluid.framework import default_main_program, Program, convert_np_dtype_to_dtype_, _non_static_mode, in_dygraph_mode +from paddle.fluid.framework import in_dygraph_mode import paddle.fluid as fluid import paddle.fluid.layers as layers -import paddle.fluid.core as core from paddle.fluid.dygraph.jit import TracedLayer import numpy as np -from paddle import _C_ops, _legacy_C_ops +from paddle import _legacy_C_ops class TestTracedLayer(fluid.dygraph.Layer): diff --git a/python/paddle/fluid/tests/unittests/test_outer.py b/python/paddle/fluid/tests/unittests/test_outer.py index d6040c298f0..a887615f0f3 100644 --- a/python/paddle/fluid/tests/unittests/test_outer.py +++ b/python/paddle/fluid/tests/unittests/test_outer.py @@ -18,7 +18,7 @@ import numpy as np import paddle from paddle.static import Program, program_guard -from paddle.fluid.framework import _test_eager_guard, in_dygraph_mode +from paddle.fluid.framework import _test_eager_guard class TestMultiplyApi(unittest.TestCase): -- GitLab