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

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

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