From 300b1009b5053f53515c4c705ac46f52f8dda945 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Mon, 10 Oct 2022 17:01:36 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused import in unittests/test_[u-z] (#46706) --- python/paddle/fluid/tests/unittests/test_unbind_op.py | 2 +- python/paddle/fluid/tests/unittests/test_unfold_op.py | 1 - .../fluid/tests/unittests/test_uniform_random_bf16_op.py | 3 +-- .../paddle/fluid/tests/unittests/test_uniform_random_op.py | 2 -- python/paddle/fluid/tests/unittests/test_unique.py | 1 - .../fluid/tests/unittests/test_unique_consecutive_op.py | 1 - .../paddle/fluid/tests/unittests/test_unique_with_counts.py | 1 - python/paddle/fluid/tests/unittests/test_unpool1d_op.py | 1 - python/paddle/fluid/tests/unittests/test_unpool_op.py | 1 - python/paddle/fluid/tests/unittests/test_var_info.py | 2 -- python/paddle/fluid/tests/unittests/test_variable.py | 3 +-- .../fluid/tests/unittests/test_view_op_reuse_allocation.py | 3 +-- python/paddle/fluid/tests/unittests/test_where_op.py | 5 +---- python/paddle/fluid/tests/unittests/test_while_loop_op.py | 2 -- python/paddle/fluid/tests/unittests/test_while_op.py | 1 - python/paddle/fluid/tests/unittests/test_yolo_box_op.py | 1 - python/paddle/fluid/tests/unittests/test_zeros_like_op.py | 2 +- python/paddle/fluid/tests/unittests/test_zeros_op.py | 5 +---- 18 files changed, 7 insertions(+), 30 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_unbind_op.py b/python/paddle/fluid/tests/unittests/test_unbind_op.py index 8634ef5f3ce..e030792ce60 100644 --- a/python/paddle/fluid/tests/unittests/test_unbind_op.py +++ b/python/paddle/fluid/tests/unittests/test_unbind_op.py @@ -18,7 +18,7 @@ from op_test import OpTest, convert_float_to_uint16 import paddle import paddle.fluid as fluid import paddle.tensor as tensor -from paddle.fluid import compiler, Program, program_guard, core +from paddle.fluid import Program, program_guard from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_unfold_op.py b/python/paddle/fluid/tests/unittests/test_unfold_op.py index 32e2adbfbf8..ea38ae2be1c 100644 --- a/python/paddle/fluid/tests/unittests/test_unfold_op.py +++ b/python/paddle/fluid/tests/unittests/test_unfold_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import numpy as np import unittest from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_uniform_random_bf16_op.py b/python/paddle/fluid/tests/unittests/test_uniform_random_bf16_op.py index 464374782a9..77d9903ceff 100644 --- a/python/paddle/fluid/tests/unittests/test_uniform_random_bf16_op.py +++ b/python/paddle/fluid/tests/unittests/test_uniform_random_bf16_op.py @@ -14,12 +14,11 @@ import unittest import numpy as np -from op_test import OpTest, convert_uint16_to_float, convert_float_to_uint16 +from op_test import OpTest, convert_uint16_to_float import paddle import paddle.fluid.core as core from paddle.fluid.op import Operator import paddle.fluid as fluid -from paddle.fluid import Program, program_guard from paddle.fluid.tests.unittests.test_uniform_random_op import output_hist, output_hist_diag diff --git a/python/paddle/fluid/tests/unittests/test_uniform_random_op.py b/python/paddle/fluid/tests/unittests/test_uniform_random_op.py index 4ffcd190444..eb72beed2c8 100644 --- a/python/paddle/fluid/tests/unittests/test_uniform_random_op.py +++ b/python/paddle/fluid/tests/unittests/test_uniform_random_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import os -import subprocess import unittest import numpy as np from op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/test_unique.py b/python/paddle/fluid/tests/unittests/test_unique.py index 48e121f1bc3..a62f5e2808d 100644 --- a/python/paddle/fluid/tests/unittests/test_unique.py +++ b/python/paddle/fluid/tests/unittests/test_unique.py @@ -18,7 +18,6 @@ from op_test import OpTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.op import Operator from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_unique_consecutive_op.py b/python/paddle/fluid/tests/unittests/test_unique_consecutive_op.py index b645eb78ba4..91a8c6d6a4b 100644 --- a/python/paddle/fluid/tests/unittests/test_unique_consecutive_op.py +++ b/python/paddle/fluid/tests/unittests/test_unique_consecutive_op.py @@ -19,7 +19,6 @@ import paddle.fluid.core as core import paddle import paddle.fluid as fluid -import paddle.fluid.framework as framework def reference_unique_consecutive(X, return_inverse=False, return_counts=False): diff --git a/python/paddle/fluid/tests/unittests/test_unique_with_counts.py b/python/paddle/fluid/tests/unittests/test_unique_with_counts.py index 95191fc110e..30fc203d933 100644 --- a/python/paddle/fluid/tests/unittests/test_unique_with_counts.py +++ b/python/paddle/fluid/tests/unittests/test_unique_with_counts.py @@ -17,7 +17,6 @@ import numpy as np from op_test import OpTest import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.op import Operator class TestUniqueWithCountsOp(OpTest): diff --git a/python/paddle/fluid/tests/unittests/test_unpool1d_op.py b/python/paddle/fluid/tests/unittests/test_unpool1d_op.py index 68949d0ef9e..f15d295ce9e 100644 --- a/python/paddle/fluid/tests/unittests/test_unpool1d_op.py +++ b/python/paddle/fluid/tests/unittests/test_unpool1d_op.py @@ -14,7 +14,6 @@ import unittest import numpy as np -from op_test import OpTest import paddle import paddle.nn.functional as F diff --git a/python/paddle/fluid/tests/unittests/test_unpool_op.py b/python/paddle/fluid/tests/unittests/test_unpool_op.py index 234714923e8..7c59d628e81 100644 --- a/python/paddle/fluid/tests/unittests/test_unpool_op.py +++ b/python/paddle/fluid/tests/unittests/test_unpool_op.py @@ -288,7 +288,6 @@ class TestUnpoolOpAPI_dy3(unittest.TestCase): def test_case(self): import paddle - import paddle.nn.functional as F import paddle.fluid.core as core import paddle.fluid as fluid import numpy as np diff --git a/python/paddle/fluid/tests/unittests/test_var_info.py b/python/paddle/fluid/tests/unittests/test_var_info.py index 5056d83bffa..7af77ae96b5 100644 --- a/python/paddle/fluid/tests/unittests/test_var_info.py +++ b/python/paddle/fluid/tests/unittests/test_var_info.py @@ -18,8 +18,6 @@ including create, config, run, etc. import paddle.fluid as fluid import numpy as np -import os -import shutil import unittest diff --git a/python/paddle/fluid/tests/unittests/test_variable.py b/python/paddle/fluid/tests/unittests/test_variable.py index efcdb6232eb..8ab9d14c924 100644 --- a/python/paddle/fluid/tests/unittests/test_variable.py +++ b/python/paddle/fluid/tests/unittests/test_variable.py @@ -16,10 +16,9 @@ import unittest from functools import reduce import paddle -from paddle.fluid.framework import default_main_program, Program, convert_np_dtype_to_dtype_, _non_static_mode +from paddle.fluid.framework import Program, convert_np_dtype_to_dtype_, default_main_program import paddle import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.core as core import numpy as np diff --git a/python/paddle/fluid/tests/unittests/test_view_op_reuse_allocation.py b/python/paddle/fluid/tests/unittests/test_view_op_reuse_allocation.py index 70778e42b7c..1f4725568a8 100644 --- a/python/paddle/fluid/tests/unittests/test_view_op_reuse_allocation.py +++ b/python/paddle/fluid/tests/unittests/test_view_op_reuse_allocation.py @@ -16,9 +16,8 @@ import unittest import numpy as np -from op_test import OpTest import paddle -from paddle.fluid.framework import _test_eager_guard, in_dygraph_mode +from paddle.fluid.framework import _test_eager_guard # NOTE(pangyoki): Tensor View Strategy. diff --git a/python/paddle/fluid/tests/unittests/test_where_op.py b/python/paddle/fluid/tests/unittests/test_where_op.py index d946527ea2a..fafa4e52791 100644 --- a/python/paddle/fluid/tests/unittests/test_where_op.py +++ b/python/paddle/fluid/tests/unittests/test_where_op.py @@ -16,11 +16,8 @@ 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 -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid.op import Operator +from paddle.fluid import Program, program_guard from paddle.fluid.backward import append_backward from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_while_loop_op.py b/python/paddle/fluid/tests/unittests/test_while_loop_op.py index 93997eeb092..7d5fc61f28b 100644 --- a/python/paddle/fluid/tests/unittests/test_while_loop_op.py +++ b/python/paddle/fluid/tests/unittests/test_while_loop_op.py @@ -19,8 +19,6 @@ import paddle import paddle.fluid as fluid import paddle.fluid.core as core import paddle.fluid.layers as layers -import paddle.fluid.framework as framework -from paddle.fluid.executor import Executor from paddle.fluid.framework import Program, program_guard from paddle.fluid.backward import append_backward diff --git a/python/paddle/fluid/tests/unittests/test_while_op.py b/python/paddle/fluid/tests/unittests/test_while_op.py index 9f747328523..648e93dede8 100644 --- a/python/paddle/fluid/tests/unittests/test_while_op.py +++ b/python/paddle/fluid/tests/unittests/test_while_op.py @@ -20,7 +20,6 @@ import paddle.fluid.core as core import paddle.fluid as fluid from paddle.fluid.backward import append_backward import numpy -from paddle.fluid import compiler, Program, program_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/test_yolo_box_op.py b/python/paddle/fluid/tests/unittests/test_yolo_box_op.py index 754f476e13f..0a4897b821d 100644 --- a/python/paddle/fluid/tests/unittests/test_yolo_box_op.py +++ b/python/paddle/fluid/tests/unittests/test_yolo_box_op.py @@ -16,7 +16,6 @@ import unittest import numpy as np from op_test import OpTest import paddle -from paddle.fluid import core from paddle.fluid.framework import _test_eager_guard diff --git a/python/paddle/fluid/tests/unittests/test_zeros_like_op.py b/python/paddle/fluid/tests/unittests/test_zeros_like_op.py index 453022511cf..0a86123ea2c 100644 --- a/python/paddle/fluid/tests/unittests/test_zeros_like_op.py +++ b/python/paddle/fluid/tests/unittests/test_zeros_like_op.py @@ -17,7 +17,7 @@ import numpy as np import paddle import paddle.fluid as fluid from paddle import zeros_like -from paddle import _C_ops, _legacy_C_ops +from paddle import _C_ops from paddle.fluid import core, Program, program_guard from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import convert_np_dtype_to_dtype_ diff --git a/python/paddle/fluid/tests/unittests/test_zeros_op.py b/python/paddle/fluid/tests/unittests/test_zeros_op.py index 031439171d5..84d83d6a7b5 100644 --- a/python/paddle/fluid/tests/unittests/test_zeros_op.py +++ b/python/paddle/fluid/tests/unittests/test_zeros_op.py @@ -14,13 +14,10 @@ import unittest import numpy as np -from op_test import OpTest import paddle import paddle.compat as cpt -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 import Program, program_guard from paddle.fluid.framework import _test_eager_guard -- GitLab