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

[CodeStyle][F401] remove unused import in unittests/test_[p-t] (#46705)

上级 2c407ef0
...@@ -19,7 +19,6 @@ from unittest import TestCase ...@@ -19,7 +19,6 @@ from unittest import TestCase
import numpy as np import numpy as np
import paddle import paddle
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph
import paddle.fluid.core as core
def _dygraph_guard_(func): def _dygraph_guard_(func):
......
...@@ -14,12 +14,11 @@ ...@@ -14,12 +14,11 @@
import os import os
import gc import gc
import sys
import unittest import unittest
import time import time
import paddle import paddle
import paddle.incubate.multiprocessing as mp import paddle.incubate.multiprocessing as mp
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph, in_dygraph_mode, _enable_legacy_dygraph from paddle.fluid.framework import _enable_legacy_dygraph, _test_eager_guard, in_dygraph_mode
REPEAT = 20 REPEAT = 20
HAS_SHM_FILES = os.path.isdir('/dev/shm') HAS_SHM_FILES = os.path.isdir('/dev/shm')
......
...@@ -16,16 +16,11 @@ import unittest ...@@ -16,16 +16,11 @@ import unittest
import numpy as np import numpy as np
from io import BytesIO from io import BytesIO
import os import os
import sys
import six
import platform import platform
import tempfile import tempfile
import paddle import paddle
import paddle.nn as nn
import paddle.optimizer as opt
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.optimizer import Adam
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
from test_imperative_base import new_program_scope from test_imperative_base import new_program_scope
......
...@@ -14,14 +14,12 @@ ...@@ -14,14 +14,12 @@
import unittest import unittest
import time import time
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import copy import copy
import os import os
import subprocess import subprocess
from paddle.distributed.utils.launch_utils import find_free_ports, watch_local_trainers, get_cluster, TrainerProc from paddle.distributed.utils.launch_utils import find_free_ports, watch_local_trainers, get_cluster, TrainerProc
from paddle.fluid.framework import _test_eager_guard
def get_cluster_from_args(selected_gpus): def get_cluster_from_args(selected_gpus):
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
import unittest import unittest
import time import time
import paddle
import paddle.fluid as fluid
import copy import copy
import os import os
import subprocess import subprocess
......
...@@ -13,14 +13,9 @@ ...@@ -13,14 +13,9 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import unittest import unittest
import paddle.fluid as fluid
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_sparse_embedding import TestSparseEmbedding
from parallel_dygraph_sparse_embedding_fp64 import TestSparseEmbeddingFP64
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
...@@ -13,14 +13,9 @@ ...@@ -13,14 +13,9 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import unittest import unittest
import paddle.fluid as fluid
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_sparse_embedding import TestSparseEmbedding
from parallel_dygraph_sparse_embedding_fp64 import TestSparseEmbeddingFP64
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
...@@ -13,13 +13,9 @@ ...@@ -13,13 +13,9 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import unittest import unittest
import paddle.fluid as fluid
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_sparse_embedding_over_height import TestSparseEmbeddingOverHeight
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
...@@ -13,13 +13,10 @@ ...@@ -13,13 +13,10 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import unittest import unittest
import paddle.fluid as fluid import paddle.fluid as fluid
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_transformer import TestTransformer
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
...@@ -13,13 +13,9 @@ ...@@ -13,13 +13,9 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import unittest import unittest
import paddle.fluid as fluid
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_unused_variables import TestSparseEmbeddingUnusedVars
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
...@@ -18,7 +18,6 @@ from paddle.fluid import compiler ...@@ -18,7 +18,6 @@ from paddle.fluid import compiler
import paddle.fluid.core as core import paddle.fluid.core as core
import unittest import unittest
import paddle import paddle
import numpy as np
import os import os
word_dict, verb_dict, label_dict = conll05.get_dict() word_dict, verb_dict, label_dict = conll05.get_dict()
......
...@@ -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.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.tests.unittests.test_profiler import TestProfiler from paddle.fluid.tests.unittests.test_profiler import TestProfiler
......
...@@ -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.fluid as fluid
import transformer_model import transformer_model
import numpy as np import numpy as np
from parallel_executor_test_base import TestParallelExecutorBase, DeviceType from parallel_executor_test_base import TestParallelExecutorBase, DeviceType
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from test_parallel_executor_transformer import *
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -17,7 +17,5 @@ import unittest ...@@ -17,7 +17,5 @@ import unittest
fluid.core.globals()['FLAGS_enable_parallel_graph'] = 1 fluid.core.globals()['FLAGS_enable_parallel_graph'] = 1
from test_parallel_executor_inference_feed_partial_data import *
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -18,8 +18,6 @@ import paddle ...@@ -18,8 +18,6 @@ import paddle
fluid.core._set_eager_deletion_mode(0.0, 0.55, True) fluid.core._set_eager_deletion_mode(0.0, 0.55, True)
from test_parallel_executor_transformer import TestTransformer
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() paddle.enable_static()
unittest.main() unittest.main()
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
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
from paddle.fluid.op import Operator
import paddle.fluid.layers as layers
import paddle.fluid as fluid
import random import random
import six import six
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.fluid as fluid
from test_parallel_dygraph_dataparallel import TestMultipleGpus from test_parallel_dygraph_dataparallel import TestMultipleGpus
......
...@@ -17,7 +17,6 @@ import paddle ...@@ -17,7 +17,6 @@ import paddle
import numpy as np import numpy as np
from op_test import OpTest from op_test import OpTest
import math import math
import os
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
paddle.enable_static() paddle.enable_static()
......
...@@ -18,8 +18,6 @@ import paddle.fluid as fluid ...@@ -18,8 +18,6 @@ import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.nn.functional as F import paddle.nn.functional as F
import numpy as np import numpy as np
from op_test import OpTest
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -17,10 +17,9 @@ import paddle ...@@ -17,10 +17,9 @@ import paddle
import numpy as np import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
from paddle.nn.functional import avg_pool2d, max_pool2d from paddle.nn.functional import avg_pool2d, max_pool2d
from test_pool2d_op import adaptive_start_index, adaptive_end_index, pool2D_forward_naive, avg_pool2D_forward_naive, max_pool2D_forward_naive from test_pool2d_op import avg_pool2D_forward_naive, max_pool2D_forward_naive, pool2D_forward_naive
class TestPool2D_API(unittest.TestCase): class TestPool2D_API(unittest.TestCase):
......
...@@ -17,11 +17,10 @@ import unittest ...@@ -17,11 +17,10 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
from paddle.nn.functional import avg_pool3d, max_pool3d from paddle.nn.functional import avg_pool3d, max_pool3d
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
from test_pool3d_op import adaptive_start_index, adaptive_end_index, pool3D_forward_naive, avg_pool3D_forward_naive, max_pool3D_forward_naive from test_pool3d_op import avg_pool3D_forward_naive, max_pool3D_forward_naive, pool3D_forward_naive
class TestPool3D_API(unittest.TestCase): class TestPool3D_API(unittest.TestCase):
......
...@@ -17,7 +17,6 @@ import unittest ...@@ -17,7 +17,6 @@ import unittest
import numpy as np import numpy as np
import paddle import paddle
import paddle.tensor as tensor
from paddle.static import Program, program_guard from paddle.static import Program, program_guard
DYNAMIC = 1 DYNAMIC = 1
......
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
import six
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid import Program, program_guard from paddle.fluid import Program
from op_test import OpTest, skip_check_grad_ci from op_test import OpTest, skip_check_grad_ci
import paddle import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
......
...@@ -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
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import unittest import unittest
import numpy as np import numpy as np
import sys
import math import math
from op_test import OpTest from op_test import OpTest
import paddle import paddle
......
...@@ -22,7 +22,6 @@ import paddle.fluid as fluid ...@@ -22,7 +22,6 @@ import paddle.fluid as fluid
import paddle.fluid.profiler as profiler import paddle.fluid.profiler as profiler
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid import compiler, Program, program_guard
import paddle.fluid.proto.profiler.profiler_pb2 as profiler_pb2 import paddle.fluid.proto.profiler.profiler_pb2 as profiler_pb2
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import unittest import unittest
import paddle
import paddle.profiler as profiler import paddle.profiler as profiler
import paddle.profiler.profiler_statistic as profiler_statistic import paddle.profiler.profiler_statistic as profiler_statistic
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
from paddle.fluid.framework import Program, default_main_program, program_guard, grad_var_name from paddle.fluid.framework import Program, default_main_program, program_guard
import paddle import paddle
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -18,8 +18,7 @@ from py_precise_roi_pool import PyPrRoIPool ...@@ -18,8 +18,7 @@ from py_precise_roi_pool import PyPrRoIPool
from op_test import OpTest from op_test import OpTest
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 compiler, Program, program_guard
class TestPRROIPoolOp(OpTest): class TestPRROIPoolOp(OpTest):
......
...@@ -16,8 +16,6 @@ import unittest ...@@ -16,8 +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.layers.nn import _pull_gpups_sparse from paddle.fluid.layers.nn import _pull_gpups_sparse
paddle.enable_static() paddle.enable_static()
......
...@@ -17,9 +17,7 @@ import numpy as np ...@@ -17,9 +17,7 @@ import numpy as np
import copy import copy
from op_test import OpTest from op_test import OpTest
import paddle import paddle
import paddle.fluid as fluid
from paddle.framework import core from paddle.framework import core
from paddle.fluid.dygraph.base import switch_to_static_graph
paddle.enable_static() paddle.enable_static()
......
...@@ -17,7 +17,6 @@ import paddle ...@@ -17,7 +17,6 @@ import paddle
import paddle.fluid as fluid 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
from threading import Thread
def user_reader(inputs): def user_reader(inputs):
......
...@@ -17,7 +17,6 @@ import itertools ...@@ -17,7 +17,6 @@ import itertools
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.layers as layers
import paddle.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import numpy as np import numpy as np
import os
import unittest import unittest
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -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,12 +14,11 @@ ...@@ -14,12 +14,11 @@
import unittest import unittest
import numpy as np import numpy as np
from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle import rand from paddle import rand
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard from paddle.fluid import Program, program_guard
import paddle import paddle
......
...@@ -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 os
import paddle import paddle
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -12,15 +12,10 @@ ...@@ -12,15 +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 op_test
import numpy as np import numpy as np
import unittest import unittest
import paddle import paddle
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid.backward import append_backward
from paddle.distributed.models.moe import utils from paddle.distributed.models.moe import utils
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -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.fluid.generator as generator import paddle.fluid.generator as generator
......
...@@ -19,7 +19,6 @@ import paddle ...@@ -19,7 +19,6 @@ 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
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import os
def check_randperm_out(n, data_np): def check_randperm_out(n, data_np):
......
...@@ -16,9 +16,7 @@ import unittest ...@@ -16,9 +16,7 @@ import unittest
import numpy as np import numpy as np
import random import random
from op_test import OpTest from op_test import OpTest
import paddle.fluid as fluid from op_test import OpTest
from paddle.fluid import Program, program_guard
from op_test import OpTest, skip_check_grad_ci
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -16,7 +16,6 @@ import unittest ...@@ -16,7 +16,6 @@ import unittest
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
import numpy as np import numpy as np
import os import os
......
...@@ -18,7 +18,7 @@ from op_test import OpTest, skip_check_grad_ci, convert_float_to_uint16 ...@@ -18,7 +18,7 @@ from op_test import OpTest, skip_check_grad_ci, convert_float_to_uint16
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
from paddle.fluid import compiler, Program, program_guard from paddle.fluid import Program, program_guard
from paddle.fluid.framework import convert_np_dtype_to_dtype_ from paddle.fluid.framework import convert_np_dtype_to_dtype_
......
...@@ -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 test_collective_base import TestDistBase from test_collective_base import TestDistBase
......
...@@ -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.fluid as fluid import paddle.fluid as fluid
import paddle import paddle
......
...@@ -21,7 +21,6 @@ import paddle ...@@ -21,7 +21,6 @@ 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 paddle.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.fluid.optimizer as optimizer
import paddle.fluid.regularizer as regularizer import paddle.fluid.regularizer as regularizer
from paddle.fluid.backward import append_backward from paddle.fluid.backward import append_backward
......
...@@ -20,10 +20,6 @@ import random ...@@ -20,10 +20,6 @@ import random
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 paddle.fluid.framework as framework
import paddle.fluid.optimizer as optimizer
import paddle.regularizer as regularizer
from paddle.fluid.backward import append_backward
def bow_net(data, def bow_net(data,
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import paddle import paddle
import numpy as np import numpy as np
import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import paddle import paddle
import numpy as np import numpy as np
import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
......
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
# limitations under the License. # limitations under the License.
import numpy as np import numpy as np
import paddle import paddle
import paddle.fluid as fluid from paddle import _legacy_C_ops
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid import framework
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import unittest import unittest
......
...@@ -18,9 +18,7 @@ import numpy as np ...@@ -18,9 +18,7 @@ import numpy as np
from op_test import OpTest, convert_float_to_uint16 from op_test import OpTest, convert_float_to_uint16
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import compiler
from paddle.static import Program, program_guard from paddle.static import Program, program_guard
import paddle.fluid.core as core
# situation 1: have shape( list, no tensor), no actual shape(Tensor) # situation 1: have shape( list, no tensor), no actual shape(Tensor)
......
...@@ -15,10 +15,8 @@ ...@@ -15,10 +15,8 @@
import unittest import unittest
import numpy as np import numpy as np
import math import math
import copy
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
from test_multiclass_nms_op import iou
from test_multiclass_nms_op import nms from test_multiclass_nms_op import nms
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
......
...@@ -28,7 +28,6 @@ import paddle.fluid.layers as layers ...@@ -28,7 +28,6 @@ import paddle.fluid.layers as layers
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.fluid import framework
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
from paddle.fluid.framework import Program from paddle.fluid.framework import Program
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.fluid.backward import append_backward
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,18 +14,15 @@ ...@@ -14,18 +14,15 @@
import unittest import unittest
import numpy as np import numpy as np
import math
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import random import random
import sys import sys
from op_test import OpTest from op_test import OpTest
sys.path.append("./rnn") sys.path.append("./rnn")
from rnn_numpy import SimpleRNN, LSTM, GRU from rnn_numpy import LSTM
from convert import get_params_for_net from convert import get_params_for_net
random.seed(2) random.seed(2)
......
...@@ -16,7 +16,6 @@ import paddle ...@@ -16,7 +16,6 @@ import paddle
import unittest import unittest
import numpy as np import numpy as np
import math import math
import sys
from op_test import OpTest from op_test import OpTest
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
import unittest import unittest
import numpy as np import numpy as np
import math
import sys
import paddle.compat as cpt
from op_test import OpTest from op_test import OpTest
from math import sqrt from math import sqrt
from math import floor from math import floor
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import paddle import paddle
import numpy as np import numpy as np
import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
......
...@@ -16,8 +16,6 @@ import unittest ...@@ -16,8 +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
class TestRot90_API(unittest.TestCase): class TestRot90_API(unittest.TestCase):
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
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 test_anchor_generator_op import anchor_generator_in_python from test_anchor_generator_op import anchor_generator_in_python
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
import unittest import unittest
import subprocess import subprocess
import sys, os import sys, os
import json
import shutil
import tempfile import tempfile
import random import random
......
...@@ -18,10 +18,10 @@ import numpy as np ...@@ -18,10 +18,10 @@ import numpy as np
import six import six
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _legacy_C_ops
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle import compat as cpt from paddle import compat as cpt
from paddle.fluid import core, framework, executor from paddle.fluid import core, framework
from paddle.fluid.layers.utils import _hash_with_id from paddle.fluid.layers.utils import _hash_with_id
from paddle.fluid.framework import _in_eager_mode_ from paddle.fluid.framework import _in_eager_mode_
from paddle.fluid.executor import _is_enable_standalone_executor, _is_dy2st_enable_standalone_executor from paddle.fluid.executor import _is_enable_standalone_executor, _is_dy2st_enable_standalone_executor
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
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
import paddle.fluid.core as core
class TestRunTimeException(unittest.TestCase): class TestRunTimeException(unittest.TestCase):
......
...@@ -14,11 +14,8 @@ ...@@ -14,11 +14,8 @@
import unittest import unittest
import numpy as np import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.op import Operator
import paddle import paddle
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
import os import os
import unittest import unittest
import numpy as np
import tempfile import tempfile
import paddle import paddle
import paddle.fluid as fluid
import paddle.nn.functional as F import paddle.nn.functional as F
......
...@@ -12,13 +12,9 @@ ...@@ -12,13 +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 numpy as np
import warnings import warnings
import unittest import unittest
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.layers.device import get_places
from paddle.fluid.executor import as_numpy
class TestSaveModelWithoutVar(unittest.TestCase): class TestSaveModelWithoutVar(unittest.TestCase):
......
...@@ -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 paddle.autograd import PyLayer from paddle.autograd import PyLayer
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import paddle.fluid.core import paddle.fluid.core
import unittest import unittest
import six
class TestScope(unittest.TestCase): class TestScope(unittest.TestCase):
......
...@@ -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
import paddle import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
paddle.enable_static() paddle.enable_static()
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import sys
import numpy as np import numpy as np
import paddle import paddle
......
...@@ -14,14 +14,11 @@ ...@@ -14,14 +14,11 @@
import unittest import unittest
import numpy as np import numpy as np
import six
import paddle.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.fluid import compiler, Program, program_guard
def ref_selu(x, def ref_selu(x,
......
...@@ -21,7 +21,7 @@ import paddle ...@@ -21,7 +21,7 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from functools import reduce from functools import reduce
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph from paddle.fluid.framework import _test_eager_guard
class TestSetValueBase(unittest.TestCase): class TestSetValueBase(unittest.TestCase):
......
...@@ -14,12 +14,7 @@ ...@@ -14,12 +14,7 @@
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.fluid as fluid
import paddle.fluid.core as core
import paddle.fluid.framework as framework
from paddle.fluid.framework import Program, program_guard
def common_setup(self, index_num, nshards, shard_id, ignore_value): def common_setup(self, index_num, nshards, shard_id, ignore_value):
......
...@@ -18,7 +18,7 @@ import paddle.fluid.core as core ...@@ -18,7 +18,7 @@ import paddle.fluid.core as core
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.fluid.backward import append_backward from paddle.fluid.backward import append_backward
from paddle.fluid.framework import default_main_program, switch_main_program from paddle.fluid.framework import switch_main_program
from paddle.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
import numpy as np import numpy as np
......
...@@ -16,11 +16,8 @@ ...@@ -16,11 +16,8 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid as fluid 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 os import os
import random
class TestShuffleBatchOpBase(OpTest): class TestShuffleBatchOpBase(OpTest):
......
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
import sys
import math
from op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core
class TestShuffleChannelOp(OpTest): class TestShuffleChannelOp(OpTest):
......
...@@ -16,9 +16,8 @@ import numpy as np ...@@ -16,9 +16,8 @@ import numpy as np
from op_test import OpTest from op_test import OpTest
from scipy.special import logit from scipy.special import logit
from scipy.special import expit from scipy.special import expit
import paddle.fluid.core as core
import unittest import unittest
from paddle.fluid import compiler, Program, program_guard from paddle.fluid import Program, program_guard
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle import paddle
......
...@@ -16,8 +16,6 @@ import paddle ...@@ -16,8 +16,6 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import numpy as np import numpy as np
import unittest import unittest
from op_test import OpTest
from test_sigmoid_focal_loss_op import sigmoid_focal_loss_forward
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
import paddle.fluid as fluid import paddle.fluid as 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 as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.fluid.layers as layers
import random import random
import sys import sys
......
...@@ -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 math
import unittest import unittest
from paddle.fluid.transpiler.distribute_transpiler import slice_variable from paddle.fluid.transpiler.distribute_transpiler import slice_variable
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core
import random import random
......
...@@ -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
import paddle.fluid.core as core import paddle.fluid.core as core
from test_softmax_op import ref_softmax from test_softmax_op import ref_softmax
......
...@@ -16,8 +16,6 @@ import unittest ...@@ -16,8 +16,6 @@ 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
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
import paddle import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
......
...@@ -616,10 +616,8 @@ class TestSolveOpSingularAPI(unittest.TestCase): ...@@ -616,10 +616,8 @@ class TestSolveOpSingularAPI(unittest.TestCase):
fetch_list=[result]) fetch_list=[result])
except RuntimeError as ex: except RuntimeError as ex:
print("The mat is singular") print("The mat is singular")
pass
except ValueError as ex: except ValueError as ex:
print("The mat is singular") print("The mat is singular")
pass
def test_static(self): def test_static(self):
for place in self.places: for place in self.places:
...@@ -637,10 +635,8 @@ class TestSolveOpSingularAPI(unittest.TestCase): ...@@ -637,10 +635,8 @@ class TestSolveOpSingularAPI(unittest.TestCase):
result = paddle.linalg.solve(input_x, input_y) result = paddle.linalg.solve(input_x, input_y)
except RuntimeError as ex: except RuntimeError as ex:
print("The mat is singular") print("The mat is singular")
pass
except ValueError as ex: except ValueError as ex:
print("The mat is singular") print("The mat is singular")
pass
def test_dygraph(self): def test_dygraph(self):
with _test_eager_guard(): with _test_eager_guard():
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
import unittest import unittest
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.layers as layers
import numpy as np import numpy as np
import six
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
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
import paddle import paddle
import numpy as np import numpy as np
import scipy
import scipy.sparse as sp
import unittest import unittest
import os import os
import re import re
......
...@@ -16,10 +16,8 @@ import unittest ...@@ -16,10 +16,8 @@ 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.core as core
from paddle.static import Program, program_guard
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.framework as framework
import paddle.nn.functional as F import paddle.nn.functional as F
import os import os
import re import re
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import paddle.incubate.sparse as sparse import paddle.incubate.sparse as sparse
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid import core
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import paddle import paddle
import numpy as np import numpy as np
import scipy
import scipy.sparse as sp import scipy.sparse as sp
import unittest import unittest
import os import os
......
...@@ -14,11 +14,7 @@ ...@@ -14,11 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
from op_test import OpTest from op_test import OpTest
import paddle
import paddle.fluid as fluid
def calculate_sparse_momentum_by_numpy(param, def calculate_sparse_momentum_by_numpy(param,
......
...@@ -16,8 +16,6 @@ import paddle ...@@ -16,8 +16,6 @@ import paddle
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import numpy as np import numpy as np
import scipy
import scipy.sparse as sp
import unittest import unittest
import os import os
import re import re
......
...@@ -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.core as core
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import copy import copy
......
...@@ -16,12 +16,8 @@ import paddle ...@@ -16,12 +16,8 @@ import paddle
from paddle.fluid.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
import numpy as np import numpy as np
import scipy
import scipy.sparse as sp import scipy.sparse as sp
import unittest import unittest
import os
import re
import math
np.random.seed(2022) np.random.seed(2022)
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle import paddle
from paddle.incubate import sparse
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.framework import _test_eager_guard from paddle.fluid.framework import _test_eager_guard
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import os import os
import numpy as np
import unittest import unittest
import paddle import paddle
......
...@@ -17,7 +17,6 @@ import numpy as np ...@@ -17,7 +17,6 @@ import numpy as np
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
from paddle.fluid import core
from paddle.fluid.framework import program_guard, Program from paddle.fluid.framework import program_guard, Program
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ 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
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard, core from paddle.fluid import Program, core, program_guard
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.
先完成此消息的编辑!
想要评论请 注册