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 2fef18fd6b5a5470287efc6c196eed43a9808564..c5859b7311659f5af41465ad2d8049e681957da8 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 03374d3d07885d9936e6064bf952fce4a37a1893..eaa8db70313085be19f6d64e960944426104f273 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 ff18e53bb0b021cf172dd10f9900bdc43f5c3c1a..1e01f3a4ce3940b407523d65adc5b1f6c9a652d9 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 8f9b39b0a48a522403f51f2c4999b5bd1e590614..00db6590d6f3fa4c71411c827967e70aab0160f0 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 62a0f00eba3496058b516098b8993e2ca27b5a9b..8d6dfab71990bf10f272b14881c4162c6f8dc5eb 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 497bcd89e176a0b36cf4653d90c0a26cc31a3f93..e004850587f4fe4ec6df6001c826237dca72bb24 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 d03e9f5998f87cff0b73fa7ea3e6f2907459a9f8..6f113c13a01a70daa60ef5b5313ede90dedc07aa 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 5ea1a7638c54d68e2eccc9a3d4c17bfa8fb433d7..bd73f628a02986bfca63c7adc7f5a81bde59b843 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 247e3861c3793dfc602a359c5ee58ec94809f7bf..03e671d883219b7a5f9c75dc24250a569b8765ca 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 65cc224eed5b7298f617029f8aaa25ea309ba275..eaf2cb528cc2a8e66a7373bfc70bbd3d4b3e709f 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 c13581351531f6ca7e75e22ab89ddb216ddcf1e8..c38d5b1fe591b61a43ae9ae44fd121807d6a314b 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 62bf274a4e46e86856452942992ded32b8d581cd..62e063179fa4c840ddb6c361ae654561c59a67ac 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 534c6d832e6cd6d3d868d42e855ad7f332064dc8..1b81f3b8f40965a19e4ea74e76c3e1a022695911 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 0ec944aba93962472f2360da5b26f94cba294653..957fe5aa42075be7c939865b0822d5c0576973c3 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 566c4929bf76acab7b74c042c10ed5f387b18bfd..2d9bd1ac650909248e84c926edad835f9b675ae6 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 7a7d76eee737f9b4dcf70b0817b809a99c3f8cfd..23d828b3cd78a4df22c40d2e0c05ba6565fad98e 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 67f7ee93c6e7436de86c048a1a35b2c93575ec2f..4129c59edca1e15d05526db6d5bf310b60de6271 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 55ffbe52a72bc68720b61b922db4064e5440ef47..566b65624e5729ada7d8953b7b88624e1e1594df 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 e9600ce8a78f88dec5bd49a8e1e5442ce0b2645f..c36445e7b0710f9cd83b7aed72f650d1c23ea4da 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 2e2024c1c40a4764ae845105f64627fd39863246..10c2ef78b861821babd8433bf1ae73f13832f7c2 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 e04565a4c3a9bf7af79224e7af9a97b97b5a6636..bd15a3ac1cbf0ee689523d5530f8b73aaeb6d903 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 9509889f0bb4abb23a73de1de0e4a53f970ff7b8..a479693d518b26e5e43995c4be7d3a1fa7fbca2e 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 d4dac6143d4473a6b8af2941d0a5546938689189..2d76f141f9ff8ea2a66525a6734a5aec6e54298d 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 96d76fcee2372b563fe494b7be0fb74ffef835fd..c87d3067cc4fde6e60725e9a2c317392a5462665 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 4d12b4311dffcb286c8bc3408e9a9802656c9f70..db701a7b733ce8b76f9672c84c678c35d1c72c5c 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 43ad2a027ee6a6e33ce6e92f3713768c5e7c7302..0c24bcd68650f6bf095c0c207c5c89486333dcf3 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 fad97b21975e65587695167d369112c3a4e547be..1ec36680fa4c27cdbd5973c07eb9481ede0b1352 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 7ef2cee14a9ab0a34d9f357d2645ae662da1b175..7d9762c788abbd0feb6227135c7998566f0035d6 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 746a01039c9c31f36d2318a61a29d1294e5ae095..6473ab7568f1994b4bd9529df5e035906777b17b 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 cdf132b72b1baab9ddc740222bf016daeb8f45c1..f0cb6ec1bbbf2b092203e1feb51b1e572d984d8d 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 80b2e28f947f3906885447dcfbd44cd4d41e4199..4de07192dd08db14d91411e86513b91780ad4062 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 05e774451b8a8aaaba0c909c803c17b1779c5e68..5c66d4cd6b5f1a63b74b2f6b8bfdafeb9dc45f6d 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 4401c6ef812292f9ac74c9a1d35565bb388549fb..b8ca9b9dc1a92ae2d2e83a9864bc8483cef1848a 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 7a2f75400beded2f64d3fec30b9be51dfe75cb2c..4caffe5019f7ccf5999efb353aa8438295cc7a03 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 92ce97d88215a3aa193b11bf6ae8d9081fde6961..af400b14615c08edd691bf5d17ed5d8c7d3b4f71 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 316079a865072302d1eba600d4bd0223cb800b87..3c3dba880047d07ddbb7c152ea01c0c99013a158 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 f7509ba1c8b09034e3500e52d5c09ef949a5f293..ee316bb0431e36451662f6549aced2f199e4971a 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 844374b641ba34100bd8a9f5b7c4d797457c4b90..cf52cdb8d47891b1dc6c0320835a23cb8af6a119 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 e334d881c8b024d5dcdd2c41468487ac4cab36c1..d55d1507f963e7d387ed5cf722ed0c0097c44384 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 f7ca51dbd69255295ce1d0436726de54503687c4..6ba980879a6c91fd25f7a09495b2d5d319a61dc9 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 9288cbda2bc824c32452f9c846fca4fbee263de0..8ab07ad9583eff66ddacc9f327acec8e7cdd5df4 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 df8a85792e039509acef415b28ed42d093173a55..f49ac0d1d5279572d010b02a9dfbc27091a12df5 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 b2554040984b2ff7537bcdd0307370f55385d00b..1f4cd926241381d3d30733ab60093b7252cf4b54 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 0e9e8f084c3d34dc7a276c2f80f49d37888ae527..67329652726a1f1510d085f80d62f25c835e00d0 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 be3ac17f66c29ef9f075c451d3e689b3991c8163..bc57d38b77c5a5e8b9f83024e54571578975ef23 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 86beb42a5631031ffd19fa1871fd7d4532b61575..474fa692b476b678f00263ee1281b2fcb5a5d6b6 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 2eecacc5fa0e860933463113326ae904cc858b9f..8649f11821eb663aa13f91a3f7de3761d4510d37 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 892e0dd98e35fa3610a41dd3b016045610fa9c8d..0236f34ea8bf92f3b3eb092c5b79ddc618eb1ddf 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 8e58aeb2c1e92b82b46a61bd904e0b1bfb9fb621..ce188cac5c7d2333b74466aa79b54974ae832561 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 71e6cca29070e7feb81548631e8db861e10d5e00..5df70185dda588a7d95c2687163912d154ce34cb 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 55d17f71567f12a9daaf5d6d29cf952f3cb2e6cc..e32245990a847267a2332b6b31eef370f8182bf9 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 1ecddc6268c9da5389c19b37d05cde19743d1979..4cf28bbd30b19e05a61394747636f1810d406899 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 419e769b9335e2a2db1f810dc4eb7e74cc7749b6..32e562773665655c4ed2ba1748296b46defa8fbc 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 096c6ce542f7f8287ba526937869d53d271909cc..ea4b9363bfce2271a236a439f6df2d7fb7cd46d8 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 4ca1480c6391404c00105c8e2b6df521bf003e15..09a1f6520ab96ad6ef002b0a0499765edd2436a3 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 bf7a7bdd5d54cd50ca075216a6b6ceda3f6e414f..aef0c8c7d0812a9f74be42d8db611aafcd8c880d 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 74fb23d84b61e85ad0a43628cbfd0878def5c191..b84530ccc41d7f152b79cfedf59062940177b620 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 d5706ab618dae0de347759d4c4fe2be2577d2905..dc9444f2f5fe2bde61384cb65e958efb6b11a9ee 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 825a6b8fa49e1def74e272f716fe401908fd0ffd..e1033ae881e81cbbb2f7b118f8d5a1707189defc 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 31ef652c3c408229c6ce960c29b18d5553430007..fbfd18a4778017f0cf293e7d479898dcc8e850ed 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 60a77b47c48c87a9915f1277490caf727b677bc0..3155140518de5e62846d3cf02d151e066bd5de87 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 fc69296021365f21b7d9605dd5bfc4aef281bfa2..c0fe5da0cbccb8d3ae6466ebfa8d7209773768ce 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 f8fbca4516918e506d8fedb8936e88f33c13c5f1..c3157a6e9a155f2f49db8bb4535b7fa30aa61f9e 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 f4015e225182b9de1339ed4ed5c3d4275c709b0a..203dcdc38cb2719f6c8cd376b9396e6d0f63a311 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 128d50f155463df12a58f3b10837b0a16e417fe9..d658fcec836dbf687158e04159a12e2a644c7d3a 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 e8adf3850a84b1527a9c8c6d314004bb96ac5a51..27a7af94485203d05418d28b9e135605245e118b 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 f8542c003985900aa9247c015d19c98888a1a248..567ac1404c66954b913ee38b56fe0a7024c0efa2 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 f71a6c6afc674ff99502631e1dc78db07d885d04..7af7b96c999b6455153d6ca6765a325188ad9ac7 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 a3c79600941bf75a6a00ef8dbb294ec7068dfc35..cd4d227e823b95a3e1d8e8056862efaf6735ef6f 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 ad8fdebfbb7c3e949f92e8ca1f2b32ee5e5eeba8..bb8b4881d3f47bcec52dbf701ea951cefe826cad 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 5fc82a976852448f533ef8da059150fae83d853a..58e24e6692ad321a51c1f52cfe623eba5b48170e 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 2bdb8dde5a9efea0df7c51b66ede95313376932f..7bb76c531a31aa6e0e5b6e86b3368fc6c9a4d470 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 de6a4c051ea8d0bf5cfbea8f68ab4309ffce19fc..55abf26ea231e8fd52d10d673ab9246c01db5ae5 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 d10db304980ad77ce918a421cbedcf06284e92d3..284957a5318f14039b0c9c6735c7a8d50fe779b4 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 f8ad66fc0f116c3ba5c38559d3081af9f36fd431..8c0ceadbf581edbb71bd13b5ca7f251fd8dccc69 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 79ca0648c948f4811f575ac0040ee6a85cf5c027..ac02627f9cc1a1bb8176a219d1d0edb99266a36e 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 cac464dc077b6f236e0063461728c4c87f7d39cf..6cb4ed2fd924e5f52e745d6a1260a8956675759b 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 441e77b455cd08560a69507b3995796a6f85f83e..a8e4e7d3e8211c5c5edfc7da1a53cefa1b611b71 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 d6040c298f0c7cb47d0dbf5b3b327ae3852b822d..a887615f0f30658f68f069bcb7b57ee2dcaddfe8 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):