未验证 提交 35674c30 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][F401] remove unused imports in unittests/mkldnn (#46905)

* [CodeStyle][F401] remove unused imports in unittests/mkldnn

* fix some increment
上级 632ea575
......@@ -16,9 +16,9 @@ import six
import abc
import unittest
import numpy as np
from scipy.special import expit, erf
from scipy.special import erf
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import OpTestTool, convert_float_to_uint16
from paddle.fluid.tests.unittests.test_activation_op import TestActivation
from paddle.fluid.tests.unittests.test_gelu_op import gelu
......
......@@ -14,9 +14,9 @@
import unittest
import numpy as np
from scipy.special import expit, erf
from scipy.special import expit
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16, skip_check_grad_ci
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.test_activation_op import TestActivation, TestRelu, TestTanh, TestSqrt, TestAbs, TestLeakyRelu, TestSwish, TestHardSwish, TestRelu6, TestSigmoid
from paddle.fluid.tests.unittests.test_gelu_op import gelu
from mkldnn_op_test import check_if_mkldnn_primitives_exist_in_bwd
......
......@@ -15,10 +15,7 @@
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
from paddle.fluid.tests.unittests.op_test import OpTest, _set_use_system_allocator
from paddle.fluid.framework import grad_var_name
from paddle.fluid.tests.unittests.op_test import _set_use_system_allocator
from paddle.fluid.tests.unittests.test_batch_norm_op import TestBatchNormOpInference, TestBatchNormOpTraining, _reference_training, _reference_grad
from mkldnn_op_test import check_if_mkldnn_batchnorm_primitives_exist_in_bwd
......
......@@ -15,9 +15,6 @@
import unittest
import numpy as np
import math
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.op_test import skip_check_grad_ci
......
......@@ -15,9 +15,6 @@
import unittest
import numpy as np
import math
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.op_test import skip_check_grad_ci
......
......@@ -17,8 +17,6 @@ import numpy as np
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
......
......@@ -14,10 +14,9 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle import enable_static
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16, OpTestTool
......
......@@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, skip_check_grad_ci
from paddle.fluid.tests.unittests.test_conv2d_op import TestConv2DOp, TestConv2DOp_v2
......
......@@ -14,10 +14,9 @@
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle import enable_static
from paddle.fluid.tests.unittests.test_conv2d_transpose_op import conv2dtranspose_forward_naive, TestConv2DTransposeOp
from paddle.fluid.tests.unittests.test_conv2d_transpose_op import TestConv2DTransposeOp
def conv2d_bias_naive(out, bias):
......
......@@ -14,7 +14,7 @@
import unittest
import numpy as np
from paddle.fluid.tests.unittests.test_conv3d_op import TestConv3DOp, TestCase1, TestWithGroup1, TestWithGroup2, TestWith1x1, TestWithInput1x1Filter1x1, TestConv3DOp_2
from paddle.fluid.tests.unittests.test_conv3d_op import TestCase1, TestConv3DOp, TestWith1x1, TestWithGroup1, TestWithGroup2, TestWithInput1x1Filter1x1
class TestMKLDNN(TestConv3DOp):
......
......@@ -15,8 +15,7 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard, core
from paddle.fluid import core
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
......
......@@ -14,11 +14,10 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.test_fusion_gru_op import fusion_gru
from paddle.fluid.tests.unittests.test_fusion_lstm_op import fc, ACTIVATION
from paddle.fluid.tests.unittests.test_fusion_lstm_op import ACTIVATION
@unittest.skipIf(not core.supports_bfloat16(),
......
......@@ -16,7 +16,7 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.test_fusion_gru_op import fusion_gru
from paddle.fluid.tests.unittests.test_fusion_lstm_op import fc, ACTIVATION
from paddle.fluid.tests.unittests.test_fusion_lstm_op import ACTIVATION
class TestFusionGRUINT8MKLDNNOp(OpTest):
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import unittest
import numpy as np
from paddle.fluid.tests.unittests.test_fusion_gru_op import TestFusionGRUOp
......
......@@ -14,11 +14,9 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16, convert_uint16_to_float
from paddle.fluid.tests.unittests.test_fusion_lstm_op import TestFusionLSTMOp, fc, ACTIVATION, fusion_lstm
from paddle.fluid.tests.unittests.test_fusion_gru_op import fusion_gru
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.test_fusion_lstm_op import ACTIVATION, fusion_lstm
@unittest.skipIf(not core.supports_bfloat16(),
......
......@@ -15,7 +15,7 @@
import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.test_fusion_lstm_op import fc, ACTIVATION, fusion_lstm
from paddle.fluid.tests.unittests.test_fusion_lstm_op import ACTIVATION, fusion_lstm
class TestFusionLSTMINT8MKLDNNOp(OpTest):
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import unittest
import numpy as np
from paddle.fluid.tests.unittests.test_fusion_lstm_op import TestFusionLSTMOp
......
......@@ -24,7 +24,7 @@ from functools import reduce
from paddle.fluid.tests.unittests.mkldnn.test_layer_norm_mkldnn_op import TestLayerNormMKLDNNOp
from paddle.fluid.tests.unittests.mkldnn.test_layer_norm_mkldnn_op import _reference_layer_norm_naive
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import _set_use_system_allocator
np.random.random(123)
......
......@@ -14,7 +14,6 @@
import unittest
from paddle.fluid.tests.unittests.test_lrn_op import TestLRNOp
import paddle.fluid as fluid
class TestLRNMKLDNNOp(TestLRNOp):
......
......@@ -13,10 +13,9 @@
# limitations under the License.
import unittest
import os
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, skip_check_grad_ci, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle import enable_static
......
......@@ -13,14 +13,11 @@
# limitations under the License.
import unittest
from functools import reduce
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
import paddle.fluid.core as core
import paddle
import paddle.fluid as fluid
import paddle.fluid.framework as framework
from paddle.fluid.tests.unittests.mkldnn.test_matmul_mkldnn_op import (
TestMatMulOpTransposeReshapeEmptyFloat,
TestMatMulOpTransposeReshapeBasicFloat,
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
from numpy.matrixlib import defmatrix
import paddle
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16, OpTestTool
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.test_fusion_gru_op import fusion_gru, ACTIVATION
from paddle.fluid.dygraph.base import disable_dygraph
def multi_gru(
......
......@@ -16,12 +16,10 @@ import os
import time
import sys
import random
import math
import functools
import contextlib
import tempfile
import numpy as np
from PIL import Image, ImageEnhance
from PIL import Image
import paddle
import paddle.fluid as fluid
from paddle.dataset.common import download
......@@ -158,7 +156,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
def tearDown(self):
self.root_path.cleanup()
pass
def cache_unzipping(self, target_folder, zip_path):
if not os.path.exists(target_folder):
......
......@@ -17,7 +17,7 @@ import numpy as np
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.tests.unittests.test_pool2d_op import TestPool2D_Op, avg_pool2D_forward_naive, max_pool2D_forward_naive
from paddle.fluid.tests.unittests.test_pool2d_op import TestPool2D_Op, max_pool2D_forward_naive
class TestPool2DMKLDNNInt8_Op(TestPool2D_Op):
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTestTool, OpTest, skip_check_grad_ci, convert_float_to_uint16
import paddle.fluid.core as core
import paddle.fluid as fluid
import paddle
paddle.enable_static()
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, skip_check_grad_ci
import paddle.fluid as fluid
import paddle
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import struct
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest
import paddle
import paddle.fluid as fluid
class TestScaleOp(OpTest):
......
......@@ -17,7 +17,6 @@ import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool
import paddle
from paddle.fluid import core
from paddle.fluid.op import Operator
@OpTestTool.skip_if_not_cpu_bf16()
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
......
......@@ -16,8 +16,6 @@ import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle
......
......@@ -16,9 +16,6 @@ import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, convert_float_to_uint16
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.framework import _current_expected_place
def ref_softplus(x, beta, threshold):
......
......@@ -15,8 +15,7 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard, core
from paddle.fluid import core
from paddle.fluid.tests.unittests.op_test import OpTest
......
......@@ -15,8 +15,6 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard, core
from paddle.fluid.tests.unittests.op_test import OpTest
......
......@@ -14,9 +14,8 @@
import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, skip_check_grad_ci
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
......
......@@ -15,10 +15,9 @@
import unittest
import paddle.fluid.core as core
from paddle.fluid.tests.unittests.test_sum_op import TestSumOp
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import convert_float_to_uint16
from paddle import enable_static
import numpy as np
import paddle.fluid.op as fluid_op
@unittest.skipIf(not core.supports_bfloat16(),
......
......@@ -16,7 +16,6 @@
import os
import unittest
import time # temp for debug
import paddle.fluid as fluid
import numpy as np
import paddle
......
......@@ -18,7 +18,6 @@ including create, config, run, etc.
import paddle
import paddle.fluid as fluid
import paddle.compat as cpt
import paddle.fluid.core as core
import os
import tempfile
......
......@@ -17,7 +17,6 @@ import unittest
import paddle
import paddle.fluid as fluid
import paddle.compat as cpt
import paddle.fluid.core as core
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import unittest
import sys
import inspect
from paddle.distributed.fleet.utils.fs import FS
......
......@@ -16,7 +16,6 @@
import unittest
import paddle
import paddle.fluid.generator as generator
import time # temp for debug
class TestGenerator(unittest.TestCase):
......
......@@ -17,7 +17,6 @@ import unittest
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import core
import paddle.compat as cpt
from paddle.fluid.framework import _test_eager_guard
......
......@@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import signal
import unittest
import multiprocessing
import time
import paddle.compat as cpt
from paddle.fluid.framework import _test_eager_guard
import queue
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import multiprocessing
import numpy as np
......
......@@ -19,7 +19,6 @@ from paddle.vision.models import resnet50, resnet101
import unittest
from unittest import TestCase
import numpy as np
import paddle.compat as cpt
from paddle.fluid.framework import _test_eager_guard
......
......@@ -19,7 +19,6 @@ import unittest
import multiprocessing
import time
import paddle.compat as cpt
from paddle.fluid import core
from paddle.fluid.framework import _test_eager_guard
......
......@@ -17,7 +17,6 @@ import numpy as np
from op_test import OpTest, skip_check_grad_ci, check_out_dtype
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.compat as cpt
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
import paddle.nn.functional as F
......
......@@ -19,7 +19,6 @@ import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid.op import Operator
import paddle.compat as cpt
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
......
......@@ -15,7 +15,6 @@
import unittest
import paddle.fluid.core as core
import paddle.compat as cpt
from paddle.fluid.framework import Program, default_startup_program
......
......@@ -20,7 +20,6 @@ import paddle.fluid as fluid
import paddle.fluid.framework as framework
import paddle.fluid.optimizer as optimizer
import paddle.fluid.core as core
import paddle.compat as cpt
import numpy as np
from paddle.fluid.backward import append_backward
from paddle.fluid.framework import Program, program_guard, convert_np_dtype_to_dtype_
......
......@@ -17,7 +17,6 @@ import unittest
import paddle
import paddle.fluid as fluid
import paddle.fluid.framework as framework
import paddle.compat as cpt
import numpy as np
import os
import contextlib
......
......@@ -16,7 +16,6 @@
import unittest
import paddle.fluid.generator as generator
import time # temp for debug
import paddle.fluid as fluid
import numpy as np
import paddle
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
import paddle
import paddle.compat as cpt
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
from paddle.fluid.framework import _test_eager_guard
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册