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 acde3b4a9d362451f6d5cbb600ad16d579f4bd20..495f1d4fbb606d0dedb03200a23d26e8a2ac7e78 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 854333c63e5b5329700346d80617f0f06fe33d08..332fc3fd489c4131b8cf5ed16a5f74432f9cbcd7 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 1ccf8a1fdaaf4df55b6bd8ccd528947b8acaae21..bc4c9095e8fa5bd71a3331032b4a636beda7b49a 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 96f6a6fb7911318bae46a264431c1e2777b93e5d..cdc16d4507267686af5882021444ce7bc02938fa 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 7e1c7570a58cb43d00c5fa5dcca38a50006b9a21..039d3c2051e49aabf5bf0a9c8f0febc80ea2da75 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 bcfc58a870924087ab7ebf3327cf4413507cb827..306ebf957c385516f3dae88da2afc1eafdafe52d 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 02f0f821760917dd14f9b5c23f04237a0982cb91..09d813d23769dd19beb9f5f3327b53a328954efa 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 57acdc41a254fc35af8d1e7cb71f77b61808bbe0..e5fa996f16cd88dd687719f1435151820072e646 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 67d1642af907956027e04fbdd0b8b5ff4a51ff86..ab565059013473373b8d9c57cd30ce9048adafc3 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 820bb48f47dfe936f1f465ffc32eb33ed6c47f84..811a6f6cb7c803b46fb8c4f66e01409dd89404c9 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 030478a5cde7cc4130b25f1146f2276923d78ef6..840f88198cbb5d8ecf19bc43a10e167d60e4feea 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 fc1e630f201f2e55462141e1805f6eb19508edad..7324fc100d5b80dace6a47510ea7d5f68813f0e0 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 3a10f53de7bc5ed57c7b0662174d613824482702..908be556fd1025d29fee94545f65fd2e3a76f81c 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 073abde49b6aacae00c93d0f7e8126308f106c1a..32838a21a5afc80f55109330e6ee92b0aeda697d 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 f83bd3abf3048f869d54f9cda86981f47b419e54..5b61bfa8d1be9dc6c57247482f261c94ab28a69e 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 917161bd7a7a12d6327ec1acdec8f4fed66f63d6..9b295aa12cbb8d0535b91dbf318608b1ff9fe91f 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 3ed52aaaffe4051e2f1ab118bea19da96a6e5501..74e72672369275f3d6bac4c21430687ff522259f 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 b3b3a56b72873b20772b4cbaa627b4be912f5c5a..951eec301c0952f752d653f1e363294db3bf10ff 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 5c56effc92eed7d886d085e7e4ea661371a61d65..b7924818177e75ad0c0d0389b1a3207871662a44 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 791279eaf9bf986c8d4bf8828f5d6534f03c32c5..49011dd36187d9b6dbc00051d6764558333f790a 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 fc5e6e1f7bf877e4ff3b84c045a59c749cffe291..85b05e8990ba9a3b49b42bca5b03179919787a19 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 26c91df1e74e391dabf4d9411c044883b3c5a7ab..a8bfd681634201a786435a05f930a85949705192 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 e18124ec76b67ed8b6c4edcdb9a49c0f48ebe6d7..3fbd3c6c2fef35431ffb99892b8cf5bf5798baed 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 a71044878deee5f266cba25c7fafb82bdf3c9598..7aff1acfdf7ff991ee321dc546c498da7ce7dd06 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 1487aaea71b00f8150c8e15f02e7816ace02041c..6ab52fcc836b8c7763db3c15532efb4430c672e3 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 b57e0d1cb590eeb96ccfe679ddfa86962677d0e4..c969332c5ae9d987250a687eb91076bf41ca3cc2 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 c784ac83a543d21ea6b77b713c3cedccd168e749..956e71cb69ea9b348c9b2086a5573770ae40b500 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 93d30fef11bbaaeef0f4262defcc80cf6e8c9fd4..d954e0d6ce642c9dc7d67cf3d5c3b3be4dabe90c 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 3d60dcdd16dad101714caabab008060352301f0c..582f73d525c9cd92a7de9aec31ce14cab4edeb3d 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 422fe087cbc3dc013ef64a6152415362d8594363..c7eb91e83be9110832a7e47222f1f07dfc585673 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 8adb724a9ee4302d11facb0d19aa2b9dc5751af6..f446fd1f2ade4cc67117059a8ca397e296080570 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 7d5feab778fac1408e83e7d1c6b8569372bcb724..0e09eafbdb78b897af8abcbccd3dd15f29098cc9 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 a1163070091077f8a0d844b7091a67b92c5deeae..6387346f4ec67136f8cb624251c61441aed2e31f 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 fe4283f55987aa08194ff68dca3f546a36fc4378..67f4d561f6e3e8b6ab9782508507291ca665c3e7 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 2142240a46eaf90ae0e3d48674568223c7d91ebf..ec4a7e8b1cf3a5c1e5300dd60eb1d2d77dd12140 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 9a2f749c2da3277197b9b8292e4e9176a5e8563c..36b53de7004a8af963e9576378ebb85b31360c61 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 ae0bb379e7dcf88f332eb85b18e7deb9c9913706..545bebcb960d82820cbfda41ff9ca7b989f9e2fe 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 10ab6994fb67e356ab25f441d4bbb5cdcf7e5392..614891d174dbf7686aa1ed6b7ad536247dde8d5a 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 45f999529d42f7548111299e0c336d180df3efb3..2494323d885cb5b458e7be948d5f565f15898b75 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 52e4a654a4a4a472b626f2b3a70f7de45e4abb0a..29d1cb3c25e49ecfdbd938e63021b5cf6ca27203 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 1520b654b84005a197bacf6031d8d9e9a4241f96..1296f5ce72496e9747b0ca01dd6e5f175ea7f84b 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 d2b7d50bee217397e706664d91c77cecf5f6cbae..5d93a5a5ac0b87a53555567a6fe63d3fa197a342 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 a22c6a936ed1eb7ccfb4fed0433c9ef43cbf1e53..7913e7e014857fc94a63c99ee6847534da29d60e 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 3d8035b4e324945d2379dd500bc9c224de26fa0d..e5ac263fb7d381bd6437e7b14408c220aa1ea061 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 ef57eb1819fbc9a11e37d86c5f8246f69c3c9431..d9c5f90e9eefe48cd60090fb2ebf93271f30e3ef 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 4c7f6daf7a6e34d1939d226891f580ddfc2cb280..fbd5c68ddd4f3dd480a9f7965f949c42ab1f2d58 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 0363cd92ffddf4a3b03552cdbd6178f3318c8c1c..1e7361035dfc02370d1a9bcb29ea0eaa62114a37 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 bdac4e461dc8fd7f0273706804465ce680fd52e5..55d942e0d72cea68a2e528ac97c9e29d021b4cbd 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 0f923af45086de5f3295f0011431e5f61fd336cf..2aac4dc83fe29673cd8f6293a6b9a29ddd5b32f1 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 81948d76f3acc97e4cdb945f616eb9c185567cf5..b86dae39426a7cdd294aa1a08185e153f8ab85a0 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 5bfe9892aa433c8096108a5f4bccefb226f82b9b..db0ac5189322fd57ec421247ebe4ac0fdf407732 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 4ac72eb1233bd3590e05251fa0735b2be30760be..94297432e30692dc48e58b8df17f17f76e9d8fd8 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 e7e730d9b2e25da99cf6263dd14c9f381dd51992..c13161b17cb439351b3b3b9c6da01730300eff4a 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 6c621a6853b0de05922f24201685daa7c6f2f86a..db55aff3817d7a6cdb616e294216abb8fa27046c 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 dd9e23cf73f5baf33a6f7c4353aa30b409b24c86..d4ccbc18c341109e6ffbd6060c41c606da50d354 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 7aa68050511b9151855ea581a9b4a966417dc2de..0afcd1c57343fd683a447f8dbadfb7bb4b34d0cd 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 c06d662637cea41f869cf42dc795370841267d11..8473f9c506dfc2e2eb5a7d5d5d42df8ecd48d047 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 5e11dedb1ed0c0d41cef7c4310ed5d5429b81e7c..2ec886796f0b6abd3b607607507fc54b9a93b472 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 2619bd872406906a9f5868fa26116fa68c914d9f..554508b877f0c79e2b38ce19fb852fdfe3742057 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 53d666e5ad217fa61765ccd1a6e2ba79343004fc..5cc9cb49e27cbdf06baa1773576d9f326242358f 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 384914218c6171a4ec35ed8ccd8e5667e4c8b192..b8d4666761a745caac32891555455d9103b41d9d 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 082b72486f6009d076deaf22fe07f1f48cd107eb..926196f2e694b4bc7bfc472f956a4a769bdb540c 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 7d97b1dfa62ee3556c7aead2e021a4f1630c4bc4..3ded60a3d804c586594866286f1b2f7838f9cfc3 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 3116a89a3978f4c009b0f664d6cf77e44630be27..579f8c1faf0fec7ed830b8d18527080e9889a055 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 049896527b94078af90b6898c3b63a8df851a778..c99c8968018106e5934c3a8c106c7a993c2443a2 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 d7bebe49df95b637b7aea400c332e20ab02d07be..f630c21c94aba839c25bcf796d18d8525b29afa0 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 e1bba6ed1bd5732b7822e1635588aeee0c346eef..620cdac1811e984ac08d489b9e523f789e6fb808 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 359ac3e4f7ab351d45706160b52351e80f44cb79..1d70b5fb3cafe3c9a42292b0fa16ecda83f428c0 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 4fd4c4b7c2d09aa6a993ef3ac9e589a5324e9977..05b9edf7d8ae327b381dd3b39e697d1474345fc1 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 26965813e3c0da4ede198082c4de44dc4be357dd..4e164840126c2c6c6a8c7c8bc5bf2b9d4dfc6ae7 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 f6f11b85b94d68702a4e7c57ddefc64ef1c0757b..116eea5bb105aafe2643ad4cd40db1afac323f22 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 9256b135ba8d04c2c3984633b176dd0a68c66765..fd6b96d7ed7e1348febf4feb2716f29fe2bd3496 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 043aeb733095c273a86b75138a267aee40a3944f..576f550f2397a776244687e17c78b7d2f3e871d9 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 347fb8afaf6fe1c24ad9b464cb639595ab465350..17bd2356eff10090296f36bc293038159a335dcb 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 c087688862b590a0cc297c4baaab5f5fed9ad0cd..f3e0287d47a58fe78e027c669b8cd4f36b97b57f 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 a8fd424758a846624212d1632b35aee95ef600ab..a338f04091d17d45da3db82284a76e65202888c2 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 b95d5523769f99685c31d2b2585ef13972f33460..0fb0a855bb0095b0acf1ba5cc09d647c18391b3c 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 e0bc5e059d8eec10ecc4b1f17d87bfde8e760273..6012ca710a9d81b0dc4046a879cc9ebb5146cad5 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 3c56a5271e40ad488d92ff92a1d52c3f4cde6db5..75bdbff364da860df8743b384d12311b4fdadf22 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 6ee9b3ab12cc7e902285694e3969f86512c4e8e6..d41ba5e59d414f5c4627271dad56256ced294aa8 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 f7e6fa0f5e3c5dd3cf1de8872af76b9f6496b652..50561fff4e6648cb45049675d18fbc339673cf96 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 6be0afd415089755534001cb78725098f55bdeb9..07f5e524ccf1ffe968a215621e0a6dc9b89d002e 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 635893f23d47fcf69e8e3e1b39928ea4a085e62a..e9c68dd19997b623fdbced85e51f984ba0bc6820 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 05df7c4d876b422d90bba5122db0496f563103d2..976252928317782195668ee00b1719fc6178201a 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 348233017379297afb917514da0503fe722e5b11..c22bb99b4a9c84f9fe01748f687c271fcb35761f 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 e2385117a18ac94da7ce7b9385b2502b69f3ff61..cb604af4f89a4a12150f91e4c797587b8d8d5b2c 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 0fc2cf3d7554b84e8136aa8be86959c258777feb..3d6ab9e04811e7d900ed8e75dea975a566d54e4e 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 4ce27d7001d47acfd17eefe2376e32e9845f5fba..fdd81c0c1384d78af951cfd6a4ed32befba71d23 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 f25cfebc0c0638ee16677ecce1f13fb5ad7723a0..f1c6873823f1b583cb3d1135bcf01ed720b7cb83 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 b3e6fe529c8d40f8f282097db75512fd512a7a51..2102348de36e4b719feba26c6b0e4f4321f57b31 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 c9ab28a2e89b651df65d84be24c14baeb5301c5b..3d74b224cbbeabff9b7a864747c684da709ae402 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 2afd16bfdb51ec3f20dcb46c5dbbfd28bff069a1..1854e164386c0987699822afc292d16ed90c875a 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 07f2ae49e6864e72f9c99450876f2f5be919c5c1..5cd42c912677ab044f9ae919ac80b9b59ad525b4 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 48a099f2dcef130ea593d7a0c5fe56015babb6b2..4ed7619bf306fd30ca5a51afc492f38f2e059580 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 1c998d62a602e1e2fe8bc1a58b327494f400ff76..6a4041dd7837a2edc3bf178c3d8fbd1781f3de3c 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 96c13ea658fb6130fd3d352ec40a8bdec82b5bef..5acd5f22b6050a0d38028ee8a29534b5f44aab35 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 590e4c9010634f38629d09def1d558b3da8ddd6f..84f949a74bf7fd3784b95235e8a2746fdca51eb2 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 3a730f267280d242b457df2225534f18c89e042b..743a818952866927e58f64aa4796ea29ca0ed18c 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 548f95a3bc7d3fa0f4641559d5ebb528988f544a..6340610a67d6ae441ba205ad6408d1b208ca5a8f 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 41e277d7a35d58114ea105eb2878b2132cc8da15..3b6136cd34646dcac8771644e60c5ca294f3c4eb 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 37604b00b0175eaa8c5381a74e31735cc92cb062..018079109c9c1d40cdca00c262e3db25db1d72df 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 8ef3bd51190ae9e2d4aa859642d55ed3672b2181..80fe5f8c1444016e06aba6d086e4200f4a2b6db3 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 95842833fa26f3569dd92accebb17b9feaca439f..3576bbdaed3b996d7b681a9510fbbd28a9a36a17 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