From 72fecaa5189168e87fb7804e72576dab7c4ee406 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 12 Oct 2022 10:28:10 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused import in unittests/xpu, test=kunlun (#46783) --- .../fluid/tests/unittests/xpu/test_accuracy_op_xpu.py | 3 --- .../paddle/fluid/tests/unittests/xpu/test_adam_op_xpu.py | 2 -- .../paddle/fluid/tests/unittests/xpu/test_adamw_op_xpu.py | 3 --- .../fluid/tests/unittests/xpu/test_arg_max_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_argsort_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py | 7 ------- .../fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py | 5 ----- .../fluid/tests/unittests/xpu/test_bce_loss_op_xpu.py | 1 - .../tests/unittests/xpu/test_bilinear_interp_op_xpu.py | 6 ------ .../tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py | 2 -- python/paddle/fluid/tests/unittests/xpu/test_bmm_op_xpu.py | 5 ----- .../fluid/tests/unittests/xpu/test_c_embedding_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_cast_op_xpu.py | 3 +-- .../fluid/tests/unittests/xpu/test_clip_by_norm_op_xpu.py | 5 +---- .../paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py | 4 +--- .../tests/unittests/xpu/test_coalesce_tensor_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_collective_base_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_concat_op_xpu.py | 4 +--- .../paddle/fluid/tests/unittests/xpu/test_conv2d_op_xpu.py | 2 -- .../tests/unittests/xpu/test_conv2d_transpose_op_xpu.py | 3 --- .../tests/unittests/xpu/test_deformable_conv_op_xpu.py | 1 - .../tests/unittests/xpu/test_depthwise_conv2d_op_xpu.py | 4 ---- .../fluid/tests/unittests/xpu/test_device_guard_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_dropout_op_xpu.py | 2 -- .../tests/unittests/xpu/test_elementwise_add_op_xpu.py | 2 +- .../tests/unittests/xpu/test_elementwise_add_op_xpu_kp.py | 2 +- .../tests/unittests/xpu/test_elementwise_div_op_xpu.py | 3 +-- .../unittests/xpu/test_elementwise_floordiv_op_xpu.py | 4 +--- .../tests/unittests/xpu/test_elementwise_max_op_xpu.py | 2 +- .../tests/unittests/xpu/test_elementwise_min_op_xpu.py | 4 +--- .../tests/unittests/xpu/test_elementwise_mod_op_xpu.py | 1 - .../tests/unittests/xpu/test_elementwise_mul_op_xpu.py | 2 +- .../tests/unittests/xpu/test_elementwise_pow_op_xpu.py | 2 -- .../tests/unittests/xpu/test_elementwise_sub_op_xpu.py | 2 +- .../paddle/fluid/tests/unittests/xpu/test_empty_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_fill_any_like_op_xpu.py | 5 ----- .../fluid/tests/unittests/xpu/test_fill_constant_op_xpu.py | 3 +-- .../fluid/tests/unittests/xpu/test_flatten2_op_xpu.py | 2 -- .../unittests/xpu/test_flatten_contiguous_range_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_flatten_op_xpu.py | 2 -- .../unittests/xpu/test_fused_resnet_basic_block_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_gen_bkcl_id_op.py | 4 +--- .../unittests/xpu/test_generate_proposals_v2_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_grid_sampler_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_huber_loss_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_instance_norm_op_xpu.py | 3 --- .../tests/unittests/xpu/test_iou_similarity_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py | 3 --- .../fluid/tests/unittests/xpu/test_layer_norm_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_log_loss_op_xpu.py | 3 --- .../fluid/tests/unittests/xpu/test_log_softmax_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_logsumexp_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_masked_select_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_matmul_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_matmul_v2_op_xpu.py | 4 ---- .../paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py | 3 --- .../tests/unittests/xpu/test_merged_momentum_op_xpu.py | 4 ---- .../fluid/tests/unittests/xpu/test_momentum_op_xpu.py | 1 - python/paddle/fluid/tests/unittests/xpu/test_mul_op_xpu.py | 2 -- .../tests/unittests/xpu/test_nearest_interp_op_xpu.py | 5 ----- .../tests/unittests/xpu/test_nearest_interp_v2_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_one_hot_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_p_norm_op_xpu.py | 3 --- .../paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py | 3 --- .../xpu/test_pow2_decay_with_linear_warmup_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_reduce_all_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_amax_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_amin_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_any_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_max_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_min_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_reduce_sum_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_refactor_op_xpu.py | 5 +---- .../fluid/tests/unittests/xpu/test_rmsprop_op_xpu.py | 1 - python/paddle/fluid/tests/unittests/xpu/test_rnn_op_xpu.py | 6 +----- .../fluid/tests/unittests/xpu/test_sampling_id_op_xpu.py | 3 --- .../paddle/fluid/tests/unittests/xpu/test_scale_op_xpu.py | 6 +----- .../tests/unittests/xpu/test_sequence_unpad_op_xpu.py | 2 -- python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py | 4 ---- .../xpu/test_sigmoid_cross_entropy_with_logits_op_xpu.py | 7 +------ .../paddle/fluid/tests/unittests/xpu/test_sign_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_slice_op_xpu.py | 1 - .../xpu/test_softmax_with_cross_entropy_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_split_op_xpu.py | 4 ---- .../fluid/tests/unittests/xpu/test_squeeze2_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_squeeze_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_stack_op_xpu.py | 5 +---- python/paddle/fluid/tests/unittests/xpu/test_sum_op_xpu.py | 6 ------ .../paddle/fluid/tests/unittests/xpu/test_tile_op_xpu.py | 3 --- .../paddle/fluid/tests/unittests/xpu/test_top_k_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_top_k_v2_op_xpu.py | 1 - .../fluid/tests/unittests/xpu/test_transpose_op_xpu.py | 5 +---- .../fluid/tests/unittests/xpu/test_tril_triu_op_xpu.py | 3 --- .../tests/unittests/xpu/test_uniform_random_op_xpu.py | 6 ------ .../fluid/tests/unittests/xpu/test_unsqueeze2_op_xpu.py | 2 -- .../fluid/tests/unittests/xpu/test_unsqueeze_op_xpu.py | 2 -- .../tests/unittests/xpu/test_update_loss_scaling_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_where_op_xpu.py | 1 - .../paddle/fluid/tests/unittests/xpu/test_while_op_xpu.py | 2 -- python/paddle/fluid/tests/unittests/xpu/test_xpu_place.py | 1 - 103 files changed, 20 insertions(+), 236 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/xpu/test_accuracy_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_accuracy_op_xpu.py index acde3b4a9d3..495f1d4fbb6 100755 --- a/python/paddle/fluid/tests/unittests/xpu/test_accuracy_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_accuracy_op_xpu.py @@ -17,9 +17,6 @@ import numpy as np import sys sys.path.append("..") -from op_test import OpTest -import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard import paddle from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_adam_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_adam_op_xpu.py index 854333c63e5..332fc3fd489 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_adam_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_adam_op_xpu.py @@ -17,10 +17,8 @@ import sys sys.path.append("..") 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 from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_adamw_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_adamw_op_xpu.py index 1ccf8a1fdaa..bc4c9095e8f 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_adamw_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_adamw_op_xpu.py @@ -18,11 +18,8 @@ sys.path.append("..") import unittest import paddle -import random import numpy as np import paddle.fluid as fluid -from functools import partial -from paddle.framework import core from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_arg_max_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_arg_max_op_xpu.py index 96f6a6fb791..cdc16d45072 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_arg_max_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_arg_max_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_argsort_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_argsort_op_xpu.py index 7e1c7570a58..039d3c2051e 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_argsort_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_argsort_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py index bcfc58a8709..306ebf957c3 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py @@ -15,15 +15,8 @@ import sys sys.path.append("..") -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 ''' class TestAssignOp(op_test.OpTest): def setUp(self): diff --git a/python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py index 02f0f821760..09d813d2376 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_batch_norm_op_xpu.py @@ -18,14 +18,9 @@ sys.path.append("..") import unittest import numpy as np 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 import paddle.nn.functional as F -from paddle.fluid import compiler, Program, program_guard -from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_bce_loss_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_bce_loss_op_xpu.py index 57acdc41a25..e5fa996f16c 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_bce_loss_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_bce_loss_op_xpu.py @@ -16,7 +16,6 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid import numpy as np import unittest from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_op_xpu.py index 67d1642af90..ab565059013 100755 --- a/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_op_xpu.py @@ -14,16 +14,10 @@ import unittest import unittest -import numpy as np import paddle -import paddle.fluid.core as core import sys sys.path.append("..") -from op_test_xpu import XPUOpTest -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard -import time paddle.enable_static() ''' diff --git a/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py index 820bb48f47d..811a6f6cb7c 100755 --- a/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py @@ -17,11 +17,9 @@ import numpy as np import sys sys.path.append("..") -from paddle.nn.functional import interpolate import paddle from op_test_xpu import XPUOpTest import unittest -import paddle.fluid as fluid from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_bmm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_bmm_op_xpu.py index 030478a5cde..840f88198cb 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_bmm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_bmm_op_xpu.py @@ -15,14 +15,9 @@ import sys sys.path.append("..") import paddle -import paddle.fluid.core as core -import paddle.fluid as fluid -import paddle.tensor as tensor import unittest import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest -from paddle.fluid.framework import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_c_embedding_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_c_embedding_op_xpu.py index fc1e630f201..7324fc100d5 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_c_embedding_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_c_embedding_op_xpu.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np import unittest import sys diff --git a/python/paddle/fluid/tests/unittests/xpu/test_cast_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_cast_op_xpu.py index 3a10f53de7b..908be556fd1 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_cast_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_cast_op_xpu.py @@ -16,12 +16,11 @@ import sys sys.path.append("..") import unittest -import op_test 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 import Program, program_guard from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_clip_by_norm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_clip_by_norm_op_xpu.py index 073abde49b6..32838a21a5a 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_clip_by_norm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_clip_by_norm_op_xpu.py @@ -17,11 +17,8 @@ import sys sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core -import paddle.fluid as fluid -from op_test_xpu import OpTest, XPUOpTest +from op_test_xpu import XPUOpTest import paddle -from paddle.fluid import Program, program_guard class TestXPUClipByNormOp(XPUOpTest): diff --git a/python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py index f83bd3abf30..5b61bfa8d1b 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py @@ -17,13 +17,11 @@ import sys sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core import paddle.fluid as fluid -from op_test_xpu import OpTest, XPUOpTest +from op_test_xpu import XPUOpTest import paddle from paddle.fluid import Program, program_guard -import op_test from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_coalesce_tensor_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_coalesce_tensor_op_xpu.py index 917161bd7a7..9b295aa12cb 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_coalesce_tensor_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_coalesce_tensor_op_xpu.py @@ -18,7 +18,6 @@ from paddle.fluid import core import sys sys.path.append("..") -from op_test import OpTest alignment = 256 import paddle diff --git a/python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py index 3ed52aaaffe..74e72672369 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py @@ -152,7 +152,6 @@ def runtime_main(test_class, col_type, sub_type): model.run_trainer(args) -import paddle.compat as cpt import socket from contextlib import closing diff --git a/python/paddle/fluid/tests/unittests/xpu/test_concat_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_concat_op_xpu.py index b3b3a56b728..951eec301c0 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_concat_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_concat_op_xpu.py @@ -18,10 +18,8 @@ sys.path.append("..") import unittest import numpy as np -import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard, core import paddle -from op_test import OpTest, skip_check_grad_ci +from op_test import skip_check_grad_ci from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_conv2d_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_conv2d_op_xpu.py index 5c56effc92e..b7924818177 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_conv2d_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_conv2d_op_xpu.py @@ -19,10 +19,8 @@ import unittest import numpy as np import paddle.fluid.core as core -import paddle.fluid as fluid from op_test_xpu import XPUOpTest import paddle -from paddle.fluid import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_conv2d_transpose_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_conv2d_transpose_op_xpu.py index 791279eaf9b..49011dd3618 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_conv2d_transpose_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_conv2d_transpose_op_xpu.py @@ -18,12 +18,9 @@ sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core -import paddle.fluid as fluid from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper import paddle -import paddle.nn as nn paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_deformable_conv_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_deformable_conv_op_xpu.py index fc5e6e1f7bf..85b05e8990b 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_deformable_conv_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_deformable_conv_op_xpu.py @@ -22,7 +22,6 @@ import paddle.fluid.core as core import paddle.fluid as fluid from op_test_xpu import OpTest, XPUOpTest import paddle -from paddle.fluid import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_depthwise_conv2d_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_depthwise_conv2d_op_xpu.py index 26c91df1e74..a8bfd681634 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_depthwise_conv2d_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_depthwise_conv2d_op_xpu.py @@ -21,10 +21,6 @@ import numpy as np import paddle paddle.enable_static() -import paddle.fluid.core as core -import paddle.fluid as fluid -from op_test_xpu import XPUOpTest -from paddle.fluid import Program, program_guard from test_conv2d_op_xpu import XPUTestConv2DOp, XPUTestConv2DOp_v2 from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_device_guard_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_device_guard_xpu.py index e18124ec76b..3fbd3c6c2fe 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_device_guard_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_device_guard_xpu.py @@ -16,9 +16,7 @@ import unittest import sys sys.path.append("..") -from op_test import OpTest -import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core diff --git a/python/paddle/fluid/tests/unittests/xpu/test_dropout_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_dropout_op_xpu.py index a71044878de..7aff1acfdf7 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_dropout_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_dropout_op_xpu.py @@ -17,9 +17,7 @@ import sys sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core from paddle import _legacy_C_ops -from op_test import OpTest, skip_check_grad_ci import paddle import paddle.fluid as fluid from paddle.fluid import Program, program_guard diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu.py index 1487aaea71b..6ab52fcc836 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu.py @@ -21,7 +21,7 @@ from op_test import OpTest, skip_check_grad_ci from op_test_xpu import XPUOpTest import unittest import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu_kp.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu_kp.py index b57e0d1cb59..c969332c5ae 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu_kp.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_add_op_xpu_kp.py @@ -21,7 +21,7 @@ from op_test import OpTest, skip_check_grad_ci from op_test_xpu import XPUOpTest import unittest import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_div_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_div_op_xpu.py index c784ac83a54..956e71cb69e 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_div_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_div_op_xpu.py @@ -18,8 +18,7 @@ import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.core as core -from op_test import OpTest, skip_check_grad_ci +from op_test import skip_check_grad_ci from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_floordiv_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_floordiv_op_xpu.py index 93d30fef11b..d954e0d6ce6 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_floordiv_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_floordiv_op_xpu.py @@ -17,9 +17,7 @@ sys.path.append("..") import unittest import numpy as np import paddle -import paddle.fluid as fluid -import paddle.fluid.core as core -from op_test import OpTest, skip_check_grad_ci +from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_max_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_max_op_xpu.py index 3d60dcdd16d..582f73d525c 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_max_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_max_op_xpu.py @@ -16,7 +16,7 @@ import sys sys.path.append("..") import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci +from op_test import skip_check_grad_ci from op_test_xpu import XPUOpTest import paddle from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_min_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_min_op_xpu.py index 422fe087cbc..c7eb91e83be 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_min_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_min_op_xpu.py @@ -16,9 +16,7 @@ import sys sys.path.append("..") import unittest import numpy as np -from op_test import OpTest, skip_check_grad_ci -import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from op_test import skip_check_grad_ci import paddle from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mod_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mod_op_xpu.py index 8adb724a9ee..f446fd1f2ad 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mod_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mod_op_xpu.py @@ -18,7 +18,6 @@ import unittest import numpy as np from op_test import OpTest import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard import paddle from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mul_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mul_op_xpu.py index 7d5feab778f..0e09eafbdb7 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mul_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_mul_op_xpu.py @@ -18,7 +18,7 @@ import unittest import numpy as np from op_test import OpTest, skip_check_grad_ci import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard import paddle from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_pow_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_pow_op_xpu.py index a1163070091..6387346f4ec 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_pow_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_pow_op_xpu.py @@ -17,8 +17,6 @@ sys.path.append("..") import unittest import numpy as np import paddle -import paddle.fluid as fluid -import paddle.fluid.core as core from op_test import OpTest, skip_check_grad_ci from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_sub_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_sub_op_xpu.py index fe4283f5598..67f4d561f6e 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_elementwise_sub_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_elementwise_sub_op_xpu.py @@ -17,7 +17,7 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest, skip_check_grad_ci +from op_test import skip_check_grad_ci from op_test_xpu import XPUOpTest import unittest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_empty_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_empty_op_xpu.py index 2142240a46e..ec4a7e8b1cf 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_empty_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_empty_op_xpu.py @@ -19,9 +19,7 @@ sys.path.append("..") import unittest import numpy as np import paddle -import paddle.fluid as fluid from op_test_xpu import XPUOpTest -from paddle.fluid import Program, program_guard from paddle.fluid.framework import convert_np_dtype_to_dtype_ from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py index 9a2f749c2da..36b53de7004 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py @@ -17,7 +17,6 @@ import unittest import sys sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py index ae0bb379e7d..545bebcb960 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py @@ -17,10 +17,8 @@ import sys import numpy as np sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle.fluid as fluid -from paddle.fluid import Program, program_guard import paddle from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_fill_any_like_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_fill_any_like_op_xpu.py index 10ab6994fb6..614891d174d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_fill_any_like_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_fill_any_like_op_xpu.py @@ -17,13 +17,8 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid -import paddle.fluid.core as core -from paddle.fluid import Program, program_guard -import paddle.compat as cpt import unittest import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_fill_constant_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_fill_constant_op_xpu.py index 45f999529d4..2494323d885 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_fill_constant_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_fill_constant_op_xpu.py @@ -17,9 +17,8 @@ import sys sys.path.append("..") import unittest import paddle -from paddle.fluid import core import numpy as np -from op_test import OpTest, convert_float_to_uint16 +from op_test import convert_float_to_uint16 from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_flatten2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_flatten2_op_xpu.py index 52e4a654a4a..29d1cb3c25e 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_flatten2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_flatten2_op_xpu.py @@ -18,8 +18,6 @@ import sys sys.path.append("..") import numpy as np import paddle -import paddle.fluid as fluid -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_flatten_contiguous_range_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_flatten_contiguous_range_op_xpu.py index 1520b654b84..1296f5ce724 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_flatten_contiguous_range_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_flatten_contiguous_range_op_xpu.py @@ -20,10 +20,8 @@ import unittest import sys sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle -import paddle.fluid as fluid from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_flatten_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_flatten_op_xpu.py index d2b7d50bee2..5d93a5a5ac0 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_flatten_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_flatten_op_xpu.py @@ -18,8 +18,6 @@ import sys sys.path.append("..") import numpy as np import paddle -import paddle.fluid as fluid -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_fused_resnet_basic_block_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_fused_resnet_basic_block_op_xpu.py index a22c6a936ed..7913e7e0148 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_fused_resnet_basic_block_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_fused_resnet_basic_block_op_xpu.py @@ -22,7 +22,6 @@ import paddle import paddle.fluid as fluid import paddle.nn as nn from paddle.fluid import core -from paddle import _legacy_C_ops from paddle.incubate.xpu.resnet_block import ResNetBasicBlock from paddle.fluid.framework import default_main_program from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_gen_bkcl_id_op.py b/python/paddle/fluid/tests/unittests/xpu/test_gen_bkcl_id_op.py index 3d8035b4e32..e5ac263fb7d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_gen_bkcl_id_op.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_gen_bkcl_id_op.py @@ -14,13 +14,11 @@ import unittest import os -import copy import sys sys.path.append("..") from launch_function_helper import wait, _find_free_port -from multiprocessing import Pool, Process -from threading import Thread +from multiprocessing import Process os.environ['GLOG_vmodule'] = str("gen_bkcl_id_op*=10,gen_comm_id*=10") diff --git a/python/paddle/fluid/tests/unittests/xpu/test_generate_proposals_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_generate_proposals_v2_op_xpu.py index ef57eb1819f..d9c5f90e9ee 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_generate_proposals_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_generate_proposals_v2_op_xpu.py @@ -20,10 +20,8 @@ sys.path.append("..") import math import paddle -import paddle.fluid as fluid import paddle.fluid.core as core -from op_test import OpTest import copy from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_grid_sampler_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_grid_sampler_op_xpu.py index 4c7f6daf7a6..fbd5c68ddd4 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_grid_sampler_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_grid_sampler_op_xpu.py @@ -20,7 +20,6 @@ sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_huber_loss_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_huber_loss_op_xpu.py index 0363cd92ffd..1e7361035df 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_huber_loss_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_huber_loss_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid from op_test import OpTest from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_instance_norm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_instance_norm_op_xpu.py index bdac4e461dc..55d942e0d72 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_instance_norm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_instance_norm_op_xpu.py @@ -16,12 +16,9 @@ import paddle import numpy as np import sys import unittest -from functools import reduce sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest -from operator import mul from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_iou_similarity_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_iou_similarity_op_xpu.py index 0f923af4508..2aac4dc83fe 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_iou_similarity_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_iou_similarity_op_xpu.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import numpy.random as random import sys diff --git a/python/paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py index 81948d76f3a..b86dae39426 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py @@ -18,9 +18,6 @@ sys.path.append("..") import unittest import numpy as np from op_test_xpu import XPUOpTest -from paddle.fluid import core -from paddle.fluid.op import Operator -import paddle.fluid as fluid import paddle from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_layer_norm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_layer_norm_op_xpu.py index 5bfe9892aa4..db0ac518932 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_layer_norm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_layer_norm_op_xpu.py @@ -19,7 +19,6 @@ import unittest from functools import reduce sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest from operator import mul from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_log_loss_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_log_loss_op_xpu.py index 4ac72eb1233..94297432e30 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_log_loss_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_log_loss_op_xpu.py @@ -15,13 +15,10 @@ import sys sys.path.append("..") -import paddle.fluid.core as core 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 def sigmoid_array(x): diff --git a/python/paddle/fluid/tests/unittests/xpu/test_log_softmax_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_log_softmax_op_xpu.py index e7e730d9b2e..c13161b17cb 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_log_softmax_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_log_softmax_op_xpu.py @@ -17,10 +17,8 @@ import numpy as np import sys sys.path.append("..") -from op_test import OpTest import paddle -import paddle.fluid.core as core import paddle.nn.functional as F from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_logsumexp_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_logsumexp_op_xpu.py index 6c621a6853b..db55aff3817 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_logsumexp_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_logsumexp_op_xpu.py @@ -18,7 +18,6 @@ import sys sys.path.append("..") import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_masked_select_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_masked_select_op_xpu.py index dd9e23cf73f..d4ccbc18c34 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_masked_select_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_masked_select_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_matmul_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_matmul_op_xpu.py index 7aa68050511..0afcd1c5734 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_matmul_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_matmul_op_xpu.py @@ -15,7 +15,6 @@ import sys sys.path.append("..") -import paddle.fluid.core as core import unittest import numpy as np from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_matmul_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_matmul_v2_op_xpu.py index c06d662637c..8473f9c506d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_matmul_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_matmul_v2_op_xpu.py @@ -18,12 +18,8 @@ sys.path.append("..") import unittest import numpy as np from op_test_xpu import XPUOpTest -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 from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py index 5e11dedb1ed..2ec886796f0 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py @@ -18,15 +18,12 @@ import sys sys.path.append("..") from op_test_xpu import XPUOpTest -from op_test import OpTest import paddle -import paddle.fluid.core as core import paddle.fluid as fluid from paddle.fluid import Program, program_guard np.random.seed(10) -import op_test from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_merged_momentum_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_merged_momentum_op_xpu.py index 2619bd87240..554508b877f 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_merged_momentum_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_merged_momentum_op_xpu.py @@ -13,16 +13,12 @@ # limitations under the License. import unittest -import numpy as np import sys sys.path.append("..") import paddle -import paddle.fluid.core as core -from op_test import OpTest -from op_test_xpu import XPUOpTest from test_merged_momentum_op_xpu_base import TestMergedMomentumBase from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_momentum_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_momentum_op_xpu.py index 53d666e5ad2..5cc9cb49e27 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_momentum_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_momentum_op_xpu.py @@ -21,7 +21,6 @@ sys.path.append("..") import paddle import paddle.fluid.core as core -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_mul_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_mul_op_xpu.py index 384914218c6..b8d4666761a 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_mul_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_mul_op_xpu.py @@ -15,14 +15,12 @@ import unittest import numpy as np import paddle -import paddle.fluid.core as core import sys sys.path.append("..") from op_test_xpu import XPUOpTest import paddle.fluid as fluid from paddle.fluid import Program, program_guard -import time paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_op_xpu.py index 082b72486f6..926196f2e69 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_op_xpu.py @@ -13,15 +13,10 @@ # limitations under the License. import unittest -import numpy as np import paddle -import paddle.fluid.core as core import sys sys.path.append("..") -from op_test_xpu import XPUOpTest -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard paddle.enable_static() ''' diff --git a/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_v2_op_xpu.py index 7d97b1dfa62..3ded60a3d80 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_nearest_interp_v2_op_xpu.py @@ -20,7 +20,6 @@ sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_one_hot_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_one_hot_op_xpu.py index 3116a89a397..579f8c1faf0 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_one_hot_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_one_hot_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle import paddle.fluid.core as core -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_p_norm_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_p_norm_op_xpu.py index 049896527b9..c99c8968018 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_p_norm_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_p_norm_op_xpu.py @@ -16,12 +16,9 @@ import paddle import numpy as np import sys import unittest -from functools import reduce sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest -from operator import mul from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py index d7bebe49df9..f630c21c94a 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py @@ -18,10 +18,7 @@ sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core from op_test_xpu import XPUOpTest -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard from test_pool2d_op import adaptive_start_index, adaptive_end_index from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper import paddle diff --git a/python/paddle/fluid/tests/unittests/xpu/test_pow2_decay_with_linear_warmup_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_pow2_decay_with_linear_warmup_op_xpu.py index e1bba6ed1bd..620cdac1811 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_pow2_decay_with_linear_warmup_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_pow2_decay_with_linear_warmup_op_xpu.py @@ -21,8 +21,6 @@ import sys sys.path.append("..") -from op_test import OpTest -from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import record_op_test diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_all_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_all_op_xpu.py index 359ac3e4f7a..1d70b5fb3ca 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_all_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_all_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_amax_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_amax_op_xpu.py index 4fd4c4b7c2d..05b9edf7d8a 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_amax_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_amax_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_amin_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_amin_op_xpu.py index 26965813e3c..4e164840126 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_amin_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_amin_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_any_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_any_op_xpu.py index f6f11b85b94..116eea5bb10 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_any_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_any_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_max_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_max_op_xpu.py index 9256b135ba8..fd6b96d7ed7 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_max_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_max_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_min_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_min_op_xpu.py index 043aeb73309..576f550f239 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_min_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_min_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py index 347fb8afaf6..17bd2356eff 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py @@ -20,7 +20,6 @@ sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_reduce_sum_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_reduce_sum_op_xpu.py index c087688862b..f3e0287d47a 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_reduce_sum_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_reduce_sum_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_refactor_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_refactor_op_xpu.py index a8fd424758a..a338f04091d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_refactor_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_refactor_op_xpu.py @@ -19,12 +19,9 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid from paddle.fluid import core -from paddle.fluid import compiler, Program, program_guard -import op_test -from op_test import OpTest, skip_check_grad_ci +from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_rmsprop_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_rmsprop_op_xpu.py index b95d5523769..0fb0a855bb0 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_rmsprop_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_rmsprop_op_xpu.py @@ -21,7 +21,6 @@ sys.path.append("..") import paddle import paddle.fluid.core as core -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_rnn_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_rnn_op_xpu.py index e0bc5e059d8..6012ca710a9 100755 --- a/python/paddle/fluid/tests/unittests/xpu/test_rnn_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_rnn_op_xpu.py @@ -15,18 +15,14 @@ import sys sys.path.append("..") import unittest import numpy as np -import math import paddle.fluid.core as core import paddle -import paddle.fluid as fluid -import paddle.fluid.layers as layers import random -from op_test import OpTest from op_test_xpu import XPUOpTest sys.path.append("../rnn") -from rnn_numpy import SimpleRNN, LSTM, GRU +from rnn_numpy import LSTM from convert import get_params_for_net from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sampling_id_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sampling_id_op_xpu.py index 3c56a5271e4..75bdbff364d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sampling_id_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sampling_id_op_xpu.py @@ -18,10 +18,7 @@ import sys sys.path.append("..") -from op_test import OpTest -import paddle.fluid.core as core import paddle.fluid as fluid -from paddle.fluid.op import Operator import paddle diff --git a/python/paddle/fluid/tests/unittests/xpu/test_scale_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_scale_op_xpu.py index 6ee9b3ab12c..d41ba5e59d4 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_scale_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_scale_op_xpu.py @@ -19,12 +19,8 @@ import sys sys.path.append("..") import paddle -import paddle.fluid as fluid -from paddle.fluid import core -from paddle.fluid import compiler, Program, program_guard +from paddle.fluid import Program, program_guard -import op_test -from op_test import OpTest, skip_check_grad_ci from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py index f7e6fa0f5e3..50561fff4e6 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py @@ -23,9 +23,7 @@ import paddle import paddle.fluid as fluid import unittest import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest -from paddle.fluid.framework import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py index 6be0afd4150..07f5e524ccf 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py @@ -15,14 +15,10 @@ import unittest import numpy as np import sys -import os sys.path.append("..") -from op_test import OpTest import paddle import paddle.fluid as fluid -from paddle.fluid import core -from paddle.fluid.op import Operator from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sigmoid_cross_entropy_with_logits_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sigmoid_cross_entropy_with_logits_op_xpu.py index 635893f23d4..e9c68dd1999 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sigmoid_cross_entropy_with_logits_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sigmoid_cross_entropy_with_logits_op_xpu.py @@ -17,14 +17,9 @@ import numpy as np import sys sys.path.append("..") -from op_test_xpu import OpTest, XPUOpTest +from op_test_xpu import XPUOpTest 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 convert_np_dtype_to_dtype_ -from paddle.fluid import compiler, Program, program_guard, core from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper from scipy.special import logit diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sign_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sign_op_xpu.py index 05df7c4d876..97625292831 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sign_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sign_op_xpu.py @@ -20,7 +20,6 @@ sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_slice_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_slice_op_xpu.py index 34823301737..c22bb99b4a9 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_slice_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_slice_op_xpu.py @@ -18,7 +18,6 @@ import sys import unittest sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py index e2385117a18..cb604af4f89 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py @@ -18,7 +18,6 @@ sys.path.append("..") from test_softmax_op import stable_softmax from op_test_xpu import XPUOpTest -import paddle.fluid.core as core import paddle import unittest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_split_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_split_op_xpu.py index 0fc2cf3d755..3d6ab9e0481 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_split_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_split_op_xpu.py @@ -17,12 +17,8 @@ import sys sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_squeeze2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_squeeze2_op_xpu.py index 4ce27d7001d..fdd81c0c138 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_squeeze2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_squeeze2_op_xpu.py @@ -19,7 +19,6 @@ sys.path.append("..") import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper import paddle diff --git a/python/paddle/fluid/tests/unittests/xpu/test_squeeze_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_squeeze_op_xpu.py index f25cfebc0c0..f1c6873823f 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_squeeze_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_squeeze_op_xpu.py @@ -22,7 +22,6 @@ import numpy as np import paddle import paddle.fluid as fluid from paddle.fluid import Program, program_guard -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_stack_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_stack_op_xpu.py index b3e6fe529c8..2102348de36 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_stack_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_stack_op_xpu.py @@ -17,12 +17,9 @@ import sys sys.path.append("..") import unittest import numpy as np -import paddle.fluid.core as core -from op_test import OpTest, skip_check_grad_ci +from op_test import skip_check_grad_ci from op_test_xpu import XPUOpTest import paddle -import paddle.fluid as fluid -from paddle.fluid import Program, program_guard from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_sum_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_sum_op_xpu.py index c9ab28a2e89..3d74b224cbb 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_sum_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_sum_op_xpu.py @@ -21,12 +21,6 @@ from op_test_xpu import XPUOpTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.op import Operator -from paddle.fluid.tests.unittests.op_test import (OpTest, - convert_float_to_uint16, - convert_uint16_to_float) -from paddle import _C_ops, _legacy_C_ops -import op_test from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_tile_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_tile_op_xpu.py index 2afd16bfdb5..1854e164386 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_tile_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_tile_op_xpu.py @@ -17,12 +17,9 @@ import numpy as np import sys sys.path.append("..") -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard -from paddle.fluid import core from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_top_k_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_top_k_op_xpu.py index 07f2ae49e68..5cd42c91267 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_top_k_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_top_k_op_xpu.py @@ -18,7 +18,6 @@ import sys sys.path.append("..") import paddle -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_top_k_v2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_top_k_v2_op_xpu.py index 48a099f2dce..4ed7619bf30 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_top_k_v2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_top_k_v2_op_xpu.py @@ -19,7 +19,6 @@ import sys sys.path.append("..") from op_test_xpu import XPUOpTest import paddle -import paddle.fluid.core as core from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_transpose_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_transpose_op_xpu.py index 1c998d62a60..6a4041dd783 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_transpose_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_transpose_op_xpu.py @@ -17,11 +17,8 @@ import numpy as np import sys sys.path.append("..") -from op_test_xpu import OpTest, XPUOpTest +from op_test_xpu import XPUOpTest import paddle -import paddle.fluid.core as core -import paddle.fluid as fluid -from paddle.fluid import compiler, Program, program_guard class TestXPUTransposeOp(XPUOpTest): diff --git a/python/paddle/fluid/tests/unittests/xpu/test_tril_triu_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_tril_triu_op_xpu.py index 96c13ea658f..5acd5f22b60 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_tril_triu_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_tril_triu_op_xpu.py @@ -15,14 +15,11 @@ import sys sys.path.append("..") import paddle -import paddle.fluid.core as core import paddle.fluid as fluid import paddle.tensor as tensor import unittest import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest -from paddle.fluid.framework import Program, program_guard from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_uniform_random_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_uniform_random_op_xpu.py index 590e4c90106..84f949a74bf 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_uniform_random_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_uniform_random_op_xpu.py @@ -15,15 +15,9 @@ import sys sys.path.append("..") -import subprocess 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 -from paddle.fluid import Program, program_guard from test_uniform_random_op import TestUniformRandomOp, TestUniformRandomOpSelectedRows paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze2_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze2_op_xpu.py index 3a730f26728..743a8189528 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze2_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze2_op_xpu.py @@ -20,8 +20,6 @@ sys.path.append("..") import numpy as np import paddle -import paddle.fluid as fluid -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze_op_xpu.py index 548f95a3bc7..6340610a67d 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_unsqueeze_op_xpu.py @@ -20,8 +20,6 @@ sys.path.append("..") import numpy as np import paddle -import paddle.fluid as fluid -from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import create_test_class, get_xpu_op_support_types, XPUOpTestWrapper diff --git a/python/paddle/fluid/tests/unittests/xpu/test_update_loss_scaling_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_update_loss_scaling_op_xpu.py index 41e277d7a35..3b6136cd346 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_update_loss_scaling_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_update_loss_scaling_op_xpu.py @@ -17,7 +17,6 @@ import sys sys.path.append("..") import numpy as np -from op_test import OpTest from op_test_xpu import XPUOpTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/xpu/test_where_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_where_op_xpu.py index 37604b00b01..018079109c9 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_where_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_where_op_xpu.py @@ -20,7 +20,6 @@ sys.path.append("..") import paddle import paddle.fluid as fluid -from paddle.fluid import Program from paddle.fluid.backward import append_backward from op_test_xpu import XPUOpTest diff --git a/python/paddle/fluid/tests/unittests/xpu/test_while_op_xpu.py b/python/paddle/fluid/tests/unittests/xpu/test_while_op_xpu.py index 8ef3bd51190..80fe5f8c144 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_while_op_xpu.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_while_op_xpu.py @@ -16,11 +16,9 @@ import unittest import paddle 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.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/xpu/test_xpu_place.py b/python/paddle/fluid/tests/unittests/xpu/test_xpu_place.py index 95842833fa2..3576bbdaed3 100644 --- a/python/paddle/fluid/tests/unittests/xpu/test_xpu_place.py +++ b/python/paddle/fluid/tests/unittests/xpu/test_xpu_place.py @@ -15,7 +15,6 @@ import unittest import os import paddle -import numpy as np import paddle.fluid as fluid from paddle.fluid import core import paddle.static as static -- GitLab