未验证 提交 0773639a 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][F401] remove unused import in unittests/test_[f-j] (#46697)

上级 ebc3f43d
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
import math
from op_test import OpTest
import paddle.fluid.core as core
def quantize_max_abs(x, max_range):
......
......@@ -12,17 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import io
import os
import unittest
import numpy as np
import paddle
import paddle.nn as nn
from paddle.dataset.common import DATA_HOME
from paddle.fluid.framework import core, _non_static_mode, _test_eager_guard
from paddle.fluid.layer_helper import LayerHelper
from paddle import _C_ops, _legacy_C_ops
from paddle import _legacy_C_ops
import sys
import tempfile
......
......@@ -19,7 +19,6 @@ import paddle
import paddle.fluid as fluid
import paddle.fluid.compiler as compiler
import paddle.fluid.core as core
import six
import unittest
os.environ['CPU_NUM'] = str(4)
......
......@@ -15,8 +15,6 @@
import os
import numpy as np
import unittest
import random
import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from simple_nets import simple_fc_net_with_inputs, simple_fc_net
......
......@@ -14,10 +14,8 @@
import os
import unittest
import random
import numpy as np
import paddle.fluid as fluid
import six
import paddle
os.environ["CPU_NUM"] = "2"
......
......@@ -14,7 +14,6 @@
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import op_test
import numpy as np
import unittest
......
......@@ -13,10 +13,7 @@
# limitations under the License.
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, convert_float_to_uint16
......
......@@ -13,12 +13,9 @@
# limitations under the License.
import paddle
import paddle.fluid.core as core
from paddle.fluid.framework import _test_eager_guard, in_dygraph_mode
import unittest
import numpy as np
from op_test import OpTest
from paddle.tensor.manipulation import fill_
class TestFillAnyOp(OpTest):
......
......@@ -13,9 +13,6 @@
# limitations under the License.
import paddle
import paddle.fluid.core as core
from paddle.static import program_guard, Program
import paddle.compat as cpt
import unittest
import numpy as np
from op_test import OpTest
......
......@@ -21,7 +21,7 @@ import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
import numpy as np
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard
# Situation 1: Attr(shape) is a list(without tensor)
......
......@@ -12,14 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle.fluid as fluid
import paddle.nn.functional as F
import unittest
import numpy as np
import six
import paddle
from op_test import OpTest
from paddle.fluid.layers import core
def fill_diagonal_ndarray(x, value, offset=0, dim1=0, dim2=1):
......
......@@ -15,13 +15,7 @@
import unittest
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.core as core
import paddle.fluid.layers as layers
from op_test import OpTest
import random
from decorator_helper import prog_scope
from paddle.fluid.op import Operator
"""This is Test Case 1"""
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import paddle.fluid as fluid
import paddle
from op_test import OpTest
......
......@@ -15,7 +15,6 @@
import os
import unittest
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestFleet1(unittest.TestCase):
......@@ -34,7 +33,6 @@ class TestFleet1(unittest.TestCase):
"""Test cases for pslib."""
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
os.environ["POD_IP"] = "127.0.0.1"
......
......@@ -12,14 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import os
import time
import six
import copy
import json
import unittest
import paddle.fluid as fluid
import paddle.distributed.fleet.ascend_utils as ascend_utils
......
......@@ -16,7 +16,6 @@ import unittest
import paddle
import os
import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
paddle.enable_static()
......
......@@ -18,7 +18,6 @@ import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import os
import paddle.fluid as fluid
import paddle.nn as nn
import numpy as np
......
......@@ -17,7 +17,6 @@ import os
import paddle
import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.fluid as fluid
paddle.enable_static()
......
......@@ -15,7 +15,6 @@
import unittest
import paddle
import os
import paddle.fluid as fluid
import paddle.distributed.fleet as fleet
paddle.enable_static()
......
......@@ -22,7 +22,6 @@ else:
os.environ['CUDA_VISIBLE_DEVICES'] = cuda_visible_devices.split(',')[0]
import paddle
import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.fluid as fluid
import unittest
import paddle.nn as nn
......
......@@ -13,13 +13,8 @@
# limitations under the License.
import os
import time
import json
import unittest
import argparse
import tempfile
import traceback
from warnings import catch_warnings
from paddle.distributed.fleet.elastic.collective import CollectiveLauncher
from paddle.distributed.fleet.launch import launch_collective
......
......@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import time
import unittest
import argparse
from warnings import catch_warnings
from paddle.distributed.fleet.elastic import enable_elastic, launch_elastic
from paddle.distributed.fleet.launch_utils import DistributeMode
......
......@@ -13,13 +13,10 @@
# limitations under the License.
import os
import time
import unittest
import argparse
from paddle.distributed.fleet.elastic.manager import ElasticManager
from paddle.distributed.fleet.elastic.manager import LauncherInterface
from paddle.distributed.fleet.elastic.manager import ELASTIC_TIMEOUT
from paddle.distributed.fleet.elastic.manager import ELASTIC_AUTO_PARALLEL_EXIT_CODE
......
......@@ -14,8 +14,7 @@
import unittest
import paddle
import paddle.fluid.core as core
from paddle.distributed.fleet.fleet_executor_utils import TaskNode, FleetExecutorUtils
from paddle.distributed.fleet.fleet_executor_utils import FleetExecutorUtils
paddle.enable_static()
......
......@@ -16,7 +16,6 @@
import numpy as np
import paddle
import paddle.fluid as fluid
import os
import unittest
import numpy as np
import paddle.distributed.fleet.metrics.metric as metric
......
......@@ -15,7 +15,6 @@
import os
import unittest
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestFleet1(unittest.TestCase):
......@@ -33,7 +32,6 @@ class TestFleet1(unittest.TestCase):
"""Test cases for pslib."""
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
os.environ["POD_IP"] = "127.0.0.1"
......
......@@ -61,7 +61,6 @@ class TestCloudRoleMaker(unittest.TestCase):
"""Test cases for pslib."""
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
os.environ["POD_IP"] = "127.0.0.1"
......
......@@ -18,8 +18,6 @@ import os
import unittest
import tempfile
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestCloudRoleMaker2(unittest.TestCase):
"""
......
......@@ -15,7 +15,6 @@
import os
import unittest
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestCloudRoleMaker(unittest.TestCase):
......@@ -33,7 +32,6 @@ class TestCloudRoleMaker(unittest.TestCase):
"""Test cases for pslib."""
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
os.environ["POD_IP"] = "127.0.0.1"
......
......@@ -15,7 +15,6 @@
import os
import unittest
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestCloudRoleMaker(unittest.TestCase):
......@@ -31,14 +30,8 @@ class TestCloudRoleMaker(unittest.TestCase):
def test_pslib_1(self):
"""Test cases for pslib."""
import sys
import threading
import paddle.fluid as fluid
try:
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import \
GeneralRoleMaker
from paddle.distributed.fleet.utils.http_server import KVHandler
from paddle.distributed.fleet.utils.http_server import KVServer
from paddle.distributed.fleet.utils.http_server import KVHTTPServer
......@@ -74,8 +67,6 @@ class TestCloudRoleMaker(unittest.TestCase):
raise ValueError("this is only for test")
return "fake"
import os
try:
class TmpKVHander(KVHandler):
......@@ -126,8 +117,6 @@ class TestCloudRoleMaker(unittest.TestCase):
print("warning: no KVHandler, skip test_pslib_4")
return
import sys
try:
class TmpServer(KVHTTPServer):
......
......@@ -14,11 +14,7 @@
"""Test cloud role maker."""
import os
import platform
import shutil
import tempfile
import unittest
import paddle
import paddle.distributed.fleet.base.role_maker as role_maker
......
......@@ -14,7 +14,6 @@
import unittest
import paddle
import os
class TestFleetRuntime(unittest.TestCase):
......
......@@ -15,7 +15,6 @@
import os
import unittest
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
class TestFleet1(unittest.TestCase):
......@@ -33,7 +32,6 @@ class TestFleet1(unittest.TestCase):
"""Test cases for pslib."""
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from paddle.fluid.incubate.fleet.parameter_server.pslib import PSLib
from paddle.fluid.incubate.fleet.base.role_maker import GeneralRoleMaker
os.environ["POD_IP"] = "127.0.0.1"
......
......@@ -12,15 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.fluid as fluid
import unittest
import numpy as np
import tarfile
import tempfile
import os
import sys
from paddle.dataset.common import download, DATA_HOME
from paddle.dataset.common import download
import paddle.distributed.fleet.base.role_maker as role_maker
......
......@@ -17,7 +17,6 @@ import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import Program, program_guard
from op_test import OpTest
import gradient_checker
from decorator_helper import prog_scope
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
import numpy as np
import unittest
from op_test import OpTest
......
......@@ -13,14 +13,10 @@
# limitations under the License.
import unittest
import paddle.fluid as fluid
import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet
import os
import sys
import inspect
from paddle.distributed.fleet.utils.fs import LocalFS, FS, HDFSClient, FSTimeOut, FSFileExistsError, FSFileNotExistsError
from paddle.distributed.fleet.utils.fs import FS
class FSTest(unittest.TestCase):
......
......@@ -15,9 +15,7 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
def fsp_matrix(a, b):
......
......@@ -15,7 +15,6 @@
import paddle
import paddle.fluid.core as core
from paddle.static import program_guard, Program
import paddle.compat as cpt
import unittest
import numpy as np
from op_test import OpTest
......
......@@ -14,13 +14,10 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
import paddle
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard
from paddle.fluid.framework import _test_eager_guard
......
......@@ -16,8 +16,7 @@ import unittest
import paddle
import numpy as np
import paddle.fluid.core as core
from paddle import _C_ops, _legacy_C_ops
from paddle import _legacy_C_ops
from paddle.fluid.framework import _test_eager_guard
......
......@@ -14,9 +14,7 @@
import paddle
import paddle.nn.functional as F
from paddle import fluid
import paddle.fluid.dygraph as dg
import paddle.fluid.initializer as I
import numpy as np
import unittest
from unittest import TestCase
......
......@@ -14,9 +14,7 @@
import paddle
import paddle.nn.functional as F
from paddle import fluid
import paddle.fluid.dygraph as dg
import paddle.fluid.initializer as I
import numpy as np
import unittest
from unittest import TestCase
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
......
......@@ -15,7 +15,6 @@
"""Test cases for role makers."""
import paddle
import os
import unittest
import numpy as np
import paddle.fluid.core as core
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from simple_nets import simple_fc_net, fc_with_batchnorm, init_data, bow_net
from simple_nets import bow_net, fc_with_batchnorm, init_data
from fake_reader import fake_imdb_reader
from parallel_executor_test_base import TestParallelExecutorBase, DeviceType
from functools import partial
......
......@@ -17,9 +17,7 @@ import paddle.fluid as fluid
import paddle.fluid.core as core
import numpy as np
import paddle
import paddle.dataset.mnist as mnist
import unittest
import os
def norm(*args, **kargs):
......
......@@ -15,8 +15,6 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
import paddle.incubate.nn.functional as incubate_f
from paddle.nn.layer.norm import LayerNorm
......
......@@ -15,13 +15,8 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
from paddle.incubate.nn.layer.fused_transformer import FusedMultiHeadAttention
from paddle import tensor
from paddle.fluid import layers
from paddle.static import Program, program_guard
from paddle.static import Program
import unittest
......
......@@ -15,15 +15,9 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
import paddle.incubate.nn.functional as incubate_f
from paddle.nn.layer.norm import LayerNorm
from paddle.nn.layer.common import Linear, Dropout
from paddle.nn.layer.transformer import _convert_attention_mask
from paddle import tensor
from paddle.fluid import layers
from paddle.nn.layer.common import Dropout
import unittest
from op_test import OpTest
from paddle.fluid.framework import default_main_program, _enable_legacy_dygraph
......
......@@ -15,13 +15,8 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
from paddle.incubate.nn.layer.fused_transformer import FusedBiasDropoutResidualLayerNorm
from paddle import tensor
from paddle.fluid import layers
from paddle.static import Program, program_guard
from paddle.static import Program
import unittest
......
......@@ -16,10 +16,6 @@ import unittest
import platform
import numpy as np
from op_test import OpTest, skip_check_grad_ci
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid.op import Operator
import paddle.compat as cpt
import paddle.version as ver
......
......@@ -14,8 +14,6 @@
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.nn.layer import transformer
import paddle.nn.functional as F
import paddle.incubate.nn.functional as incubate_f
......
......@@ -21,12 +21,10 @@ import numpy as np
import paddle
import paddle.nn as nn
from paddle import tensor
import unittest
from op_test import OpTest, convert_float_to_uint16, convert_uint16_to_float
from test_sparse_attention_op import get_cuda_version
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid.framework import default_main_program
from paddle import _legacy_C_ops
from paddle.fluid import core
......
......@@ -15,23 +15,15 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
import paddle.incubate.nn.functional as incubate_f
from paddle.nn.layer.norm import LayerNorm
from paddle.nn.layer.common import Linear, Dropout
from paddle.nn.layer.common import Dropout
from paddle.nn.layer.transformer import _convert_attention_mask
from paddle import tensor
from paddle.fluid import layers
import unittest
from op_test import OpTest
from paddle.fluid.framework import default_main_program
from paddle.fluid.dygraph.layers import Layer
from paddle.fluid.layer_helper import LayerHelper
from paddle.nn.initializer import Constant
from paddle.fluid.data_feeder import check_variable_and_dtype, check_dtype
from paddle.fluid.framework import _non_static_mode, default_main_program
from paddle.fluid.framework import default_main_program
from paddle import _legacy_C_ops
default_main_program().random_seed = 42
......
......@@ -15,10 +15,7 @@
import numpy as np
import paddle
import paddle.nn as nn
import paddle.fluid.core as core
import paddle.nn.functional as F
import paddle.incubate.nn.functional as incubate_f
from paddle.nn.layer.norm import LayerNorm
from paddle.nn.layer.common import Linear, Dropout
from paddle.nn.layer.transformer import _convert_attention_mask
......@@ -27,12 +24,7 @@ from paddle.fluid import layers
import unittest
from op_test import OpTest
from paddle.fluid.framework import default_main_program
from paddle.fluid.dygraph.layers import Layer
from paddle.fluid.layer_helper import LayerHelper
from paddle.nn.initializer import Constant
from paddle.fluid.data_feeder import check_variable_and_dtype, check_dtype
from paddle.fluid.framework import _non_static_mode, default_main_program
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid.framework import default_main_program
from paddle.incubate.nn.functional import fused_multi_transformer
from paddle.incubate.nn import FusedMultiTransformer
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
from op_test import OpTest
from paddle.fluid import core
import paddle.fluid as fluid
np.random.random(123)
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import paddle
from op_test import OpTest
from paddle.framework import core
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import math
from op_test import OpTest
from paddle.fluid.tests.unittests.test_gru_op import gru
from paddle.fluid.tests.unittests.test_fusion_lstm_op import fc, ACTIVATION
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import random
from op_test import OpTest
from sequence.test_sequence_conv import seqconv
......
......@@ -12,14 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.op import Operator
from paddle.fluid.executor import Executor
from paddle.fluid.tests.unittests.op_test import OpTest, convert_uint16_to_float
from paddle.fluid.framework import _test_eager_guard
import paddle
......
......@@ -17,8 +17,6 @@ import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import Program, program_guard
from op_test import OpTest
paddle.enable_static()
......
......@@ -14,10 +14,8 @@
import unittest
import numpy as np
import sys
import math
import six
import paddle.fluid as fluid
from op_test import OpTest
'''
# Equivalent code
......
......@@ -14,9 +14,6 @@
import unittest
import numpy as np
import sys
import math
import paddle.fluid as fluid
from op_test import OpTest
......
......@@ -14,10 +14,8 @@
import unittest
import numpy as np
import sys
import math
import paddle
import paddle.fluid as fluid
from op_test import OpTest
from test_anchor_generator_op import anchor_generator_in_python
import copy
......
......@@ -14,13 +14,9 @@
import unittest
import numpy as np
import sys
import math
import paddle
import paddle.fluid as fluid
from op_test import OpTest
from test_anchor_generator_op import anchor_generator_in_python
import copy
from test_generate_proposals_op import clip_tiled_boxes, box_coder, nms
......
......@@ -13,7 +13,6 @@
# limitations under the License.
"""Test cloud role maker."""
import os
import unittest
import paddle
import paddle.fluid.generator as generator
......
......@@ -14,7 +14,6 @@
import unittest
from paddle.fluid import core
from paddle import compat as cpt
class TestGetAllRegisteredOpKernels(unittest.TestCase):
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import unittest
from paddle.fluid import core
from paddle.device.cuda import device_count, get_device_properties
......
......@@ -16,9 +16,7 @@ import os
import sys
import subprocess
import unittest
import paddle
import tempfile
import paddle.fluid as fluid
from paddle.fluid import core
......
......@@ -12,14 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
import unittest
import numpy as np
import six
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid.dygraph.base import to_variable
......
......@@ -17,7 +17,6 @@ import numpy as np
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
import six
from fake_reader import fake_imdb_reader
from paddle.fluid.clip import _allow_pure_fp16_global_norm_clip
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
class TestGraphReindex(unittest.TestCase):
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.framework import _test_eager_guard
from op_test import OpTest
......
......@@ -16,7 +16,6 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.framework import _test_eager_guard
......
......@@ -15,8 +15,6 @@
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.framework import _test_eager_guard
from op_test import OpTest
......
......@@ -14,7 +14,7 @@
import numpy as np
import paddle
from paddle import fluid, nn
from paddle import fluid
import paddle.fluid.dygraph as dg
import paddle.nn.functional as F
import unittest
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
from operator import mul
import paddle.fluid.core as core
import paddle.fluid as fluid
from op_test import OpTest, skip_check_grad_ci
......
......@@ -12,14 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
from op_test import OpTest, _set_use_system_allocator
from paddle.fluid.framework import grad_var_name
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
from paddle.fluid.framework import _test_eager_guard
......
......@@ -14,9 +14,8 @@
import unittest
import numpy as np
import math
import functools
from op_test import OpTest, skip_check_grad_ci
from op_test import OpTest
from paddle.fluid.tests.unittests.test_lstm_op import ACTIVATION
from paddle import fluid
from paddle.fluid import Program, program_guard
......
......@@ -14,13 +14,10 @@
import unittest
import numpy as np
import math
from op_test import OpTest
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import random
import sys
......
......@@ -13,10 +13,8 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
import paddle
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
from paddle.fluid.framework import _test_eager_guard
paddle.enable_static()
......
......@@ -16,7 +16,6 @@ import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import Program, program_guard
from op_test import OpTest
from paddle.fluid.framework import _test_eager_guard
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
import paddle.nn.functional as F
from paddle.fluid import Program, program_guard
......
......@@ -17,7 +17,7 @@ import numpy as np
from op_test import OpTest
import paddle.fluid as fluid
import paddle
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard
def huber_loss_forward(val, delta):
......
......@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn as nn
import unittest
from paddle.distributed import fleet
import numpy as np
......
......@@ -18,7 +18,6 @@ import paddle
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
from op_test import OpTest
from paddle.fluid.framework import _test_eager_guard
class TestIdentityLossOp(OpTest):
......
......@@ -14,8 +14,6 @@
import unittest
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.core as core
import paddle
......
......@@ -13,11 +13,8 @@
# limitations under the License.
import contextlib
import unittest
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import core
@contextlib.contextmanager
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
import unittest
import numpy as np
......@@ -24,7 +23,7 @@ from test_imperative_base import new_program_scope
import paddle.fluid.dygraph_utils as dygraph_utils
from paddle.fluid.dygraph.layer_object_helper import LayerObjectHelper
import paddle
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph, _non_static_mode
from paddle.fluid.framework import _in_legacy_dygraph, _test_eager_guard
class MyLayer(fluid.Layer):
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import unittest
import numpy as np
import paddle
from collections import OrderedDict
from paddle.fluid.framework import _test_eager_guard
......
......@@ -16,7 +16,7 @@ import unittest
import paddle.fluid as fluid
import numpy as np
import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle import _legacy_C_ops
from paddle.fluid.framework import _test_eager_guard
......
......@@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid.reader import use_pinned_memory
from paddle.fluid.framework import _test_eager_guard
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import time
import unittest
import numpy as np
......
......@@ -36,7 +36,6 @@ class TestDygraphDataLoaderCleanUpFunc(unittest.TestCase):
def func_test_clear_queue_set(self):
test_queue = queue.Queue(self.capacity)
global multiprocess_queue_set
multiprocess_queue_set.add(test_queue)
for i in range(0, self.capacity):
test_queue.put(i)
......
......@@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.io import Dataset, DataLoader
from paddle.fluid.framework import _test_eager_guard
......
......@@ -17,7 +17,6 @@ import unittest
import multiprocessing
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid.reader import _reader_process_loop
from paddle.fluid.framework import _test_eager_guard
......
......@@ -12,13 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
import unittest
import numpy as np
import six
import unittest
import paddle
import paddle.fluid as fluid
import paddle.fluid.dygraph as dygraph
from paddle.fluid.dygraph.nn import Linear
......
......@@ -20,8 +20,7 @@ import unittest
from unittest import TestCase
import numpy as np
import paddle.compat as cpt
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph, _in_eager_without_dygraph_check
import paddle.fluid.core as core
from paddle.fluid.framework import _test_eager_guard
def _dygraph_guard_(func):
......
......@@ -12,17 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
import unittest
import numpy as np
import six
import sys
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.optimizer import SGDOptimizer
from paddle.fluid import Conv2D, Pool2D, Linear
from paddle.fluid import Linear
from test_imperative_base import new_program_scope
from paddle.fluid.dygraph.base import to_variable
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.
先完成此消息的编辑!
想要评论请 注册