From ea0d84bbd32efd69d54fc5decca843078c54ee10 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 12 Oct 2022 10:49:40 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused imports in unittests/dygraph_to_static,ir (#46787) * [CodeStyle][F401] remove unused imports in unittests/dygraph_to_static * [CodeStyle][F401] remove unused imports in unittests/ir * add noqa after required imports --- .../fluid/tests/unittests/dygraph_to_static/bert_utils.py | 1 - .../fluid/tests/unittests/dygraph_to_static/darknet.py | 1 - .../fluid/tests/unittests/dygraph_to_static/decos.py | 1 - .../tests/unittests/dygraph_to_static/predictor_utils.py | 2 -- .../unittests/dygraph_to_static/simnet_dygraph_model.py | 2 +- .../unittests/dygraph_to_static/test_build_strategy.py | 3 +-- .../dygraph_to_static/test_convert_call_generator.py | 7 ------- .../dygraph_to_static/test_cpu_cuda_to_tensor.py | 1 - .../unittests/dygraph_to_static/test_jit_property_save.py | 1 - .../fluid/tests/unittests/dygraph_to_static/test_lac.py | 2 +- .../fluid/tests/unittests/dygraph_to_static/test_mnist.py | 1 - .../tests/unittests/dygraph_to_static/test_mnist_amp.py | 1 - .../unittests/dygraph_to_static/test_mnist_pure_fp16.py | 5 +---- .../tests/unittests/dygraph_to_static/test_op_attr.py | 1 - .../fluid/tests/unittests/dygraph_to_static/test_place.py | 1 - .../dygraph_to_static/test_program_translator.py | 1 - .../tests/unittests/dygraph_to_static/test_resnet.py | 2 +- .../tests/unittests/dygraph_to_static/test_resnet_amp.py | 4 +--- .../unittests/dygraph_to_static/test_resnet_pure_fp16.py | 4 +--- .../dygraph_to_static/test_save_inference_model.py | 2 +- .../unittests/dygraph_to_static/test_setter_helper.py | 1 - .../tests/unittests/dygraph_to_static/test_spec_names.py | 1 - .../tests/unittests/dygraph_to_static/test_to_tensor.py | 4 ---- .../fluid/tests/unittests/dygraph_to_static/test_tsm.py | 3 --- .../tests/unittests/dygraph_to_static/test_typing.py | 2 +- .../fluid/tests/unittests/dygraph_to_static/test_utils.py | 3 --- .../dygraph_to_static/test_variable_trans_func.py | 4 ---- .../tests/unittests/dygraph_to_static/test_warning.py | 1 - .../tests/unittests/dygraph_to_static/test_word2vec.py | 6 ------ .../tests/unittests/dygraph_to_static/tsm_config_utils.py | 1 - .../fluid/tests/unittests/dygraph_to_static/yolov3.py | 5 +---- .../tests/unittests/ir/inference/inference_pass_test.py | 4 ---- .../fluid/tests/unittests/ir/inference/program_config.py | 2 +- .../tests/unittests/ir/inference/quant_dequant_test.py | 5 +---- .../test_adaptive_pool2d_convert_global_pass_autoscan.py | 7 +------ .../ir/inference/test_conv_act_mkldnn_fuse_pass.py | 8 +------- .../ir/inference/test_conv_bias_mkldnn_fuse_pass.py | 8 +------- .../unittests/ir/inference/test_conv_bn_fuse_pass.py | 3 --- .../inference/test_conv_elementwise_add_act_fuse_pass.py | 1 - .../ir/inference/test_conv_elementwise_add_fuse_pass.py | 3 --- .../ir/inference/test_conv_transpose_bn_fuse_pass.py | 6 ------ .../test_conv_transpose_eltwiseadd_bn_fuse_pass.py | 6 ------ .../ir/inference/test_delete_c_identity_op_pass.py | 1 - .../ir/inference/test_emb_eltwise_layernorm_fuse_pass.py | 3 --- .../inference/test_fc_elementwise_layernorm_fuse_pass.py | 7 +------ .../tests/unittests/ir/inference/test_fc_fuse_pass.py | 4 ---- .../tests/unittests/ir/inference/test_fc_gru_fuse_pass.py | 1 - .../unittests/ir/inference/test_fc_lstm_fuse_pass.py | 1 - .../ir/inference/test_flatten2_matmul_fuse_pass.py | 8 +------- .../ir/inference/test_identity_scale_clean_pass.py | 1 - .../unittests/ir/inference/test_layer_norm_fuse_pass.py | 5 ----- .../ir/inference/test_layernorm_shift_partition_pass.py | 5 +---- .../unittests/ir/inference/test_map_matmul_to_mul_pass.py | 6 ------ .../ir/inference/test_map_matmul_v2_to_matmul_pass.py | 6 ------ .../ir/inference/test_map_matmul_v2_to_mul_pass.py | 6 ------ .../unittests/ir/inference/test_matmul_scale_fuse_pass.py | 8 +------- .../ir/inference/test_matmul_v2_scale_fuse_pass.py | 8 +------- .../ir/inference/test_mkldnn_batch_norm_act_fuse_pass.py | 6 +----- .../ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py | 6 +----- .../tests/unittests/ir/inference/test_mkldnn_conv3d_op.py | 7 ++----- .../test_mkldnn_conv_affine_channel_fuse_pass.py | 4 ---- .../ir/inference/test_mkldnn_conv_bias_fuse_pass.py | 2 -- .../test_mkldnn_conv_elementwise_add_fuse_pass.py | 6 +----- .../ir/inference/test_mkldnn_conv_gelu_fuse_pass.py | 6 +----- .../inference/test_mkldnn_conv_hard_sigmoid_fuse_pass.py | 6 +----- .../ir/inference/test_mkldnn_conv_hard_swish_fuse_pass.py | 6 +----- .../test_mkldnn_conv_transpose_bias_fuse_pass.py | 6 +----- .../ir/inference/test_mkldnn_depthwise_conv_pass.py | 6 ------ .../ir/inference/test_mkldnn_elt_act_fuse_pass_new.py | 3 --- .../inference/test_mkldnn_fc_elementwise_add_fuse_pass.py | 6 +----- .../ir/inference/test_mkldnn_inplace_fuse_pass.py | 2 -- .../test_mkldnn_matmul_transpose_reshape_fuse_pass.py | 6 +----- .../test_mkldnn_matmul_v2_transpose_reshape_fuse_pass.py | 6 +----- .../unittests/ir/inference/test_mkldnn_matmulv2_op.py | 7 ++----- .../tests/unittests/ir/inference/test_mkldnn_pad2d_op.py | 2 +- .../tests/unittests/ir/inference/test_mkldnn_pad3d_op.py | 2 +- .../tests/unittests/ir/inference/test_mkldnn_prelu_op.py | 7 ++----- .../test_mkldnn_reshape_transpose_matmul_fuse_pass.py | 6 +----- .../test_mkldnn_reshape_transpose_matmul_v2_fuse_pass.py | 2 -- .../ir/inference/test_mkldnn_scale_matmul_fuse_pass.py | 6 +----- .../inference/test_mkldnn_shuffle_channel_detect_pass.py | 3 +-- .../unittests/ir/inference/test_mul_gru_fuse_pass.py | 7 +------ .../unittests/ir/inference/test_mul_lstm_fuse_pass.py | 7 +------ .../ir/inference/test_multihead_matmul_fuse_pass_v3.py | 8 +------- .../ir/inference/test_repeated_fc_relu_fuse_pass.py | 7 +------ .../ir/inference/test_reshape2_matmul_fuse_pass.py | 8 +------- .../ir/inference/test_seq_concat_fc_fuse_pass.py | 5 ----- .../ir/inference/test_seqconv_eltadd_relu_fuse_pass.py | 7 +------ .../ir/inference/test_seqpool_cvm_concat_fuse_pass_py.py | 7 +------ .../ir/inference/test_shuffle_channel_detect_pass.py | 5 +---- .../test_simplify_with_basic_ops_pass_autoscan.py | 7 +------ .../ir/inference/test_squared_mat_sub_fuse_pass.py | 6 +----- .../ir/inference/test_squeeze2_matmul_fuse_pass.py | 8 +------- .../inference/test_transpose_flatten_concat_fuse_pass.py | 6 +----- .../ir/inference/test_trt_anchor_generator_op.py | 1 - .../ir/inference/test_trt_c_allreduce_infer_script.py | 2 -- .../tests/unittests/ir/inference/test_trt_conv3d_op.py | 2 -- .../ir/inference/test_trt_conv3d_transpose_op.py | 2 -- .../tests/unittests/ir/inference/test_trt_conv_pass.py | 1 - .../ir/inference/test_trt_conv_quant_dequant_pass.py | 3 --- .../unittests/ir/inference/test_trt_convert_activation.py | 4 ++-- .../ir/inference/test_trt_convert_affine_channel.py | 4 ++-- .../ir/inference/test_trt_convert_anchor_generator.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_batch_norm.py | 2 +- .../ir/inference/test_trt_convert_bilinear_interp_v2.py | 4 ++-- .../ir/inference/test_trt_convert_c_allreduce.py | 2 -- .../tests/unittests/ir/inference/test_trt_convert_cast.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_clip.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_concat.py | 2 +- .../unittests/ir/inference/test_trt_convert_conv2d.py | 4 ++-- .../ir/inference/test_trt_convert_conv2d_fusion.py | 4 ++-- .../ir/inference/test_trt_convert_conv2d_transpose.py | 2 +- .../ir/inference/test_trt_convert_conv3d_transpose.py | 4 ++-- .../ir/inference/test_trt_convert_deformable_conv.py | 4 ++-- .../test_trt_convert_depthwise_conv2d_transpose.py | 2 +- .../unittests/ir/inference/test_trt_convert_dropout.py | 4 ++-- .../ir/inference/test_trt_convert_elementwise.py | 4 ++-- .../inference/test_trt_convert_emb_eltwise_layernorm.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_equal.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_fc.py | 4 ++-- .../ir/inference/test_trt_convert_fill_constant.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_flatten.py | 4 ++-- .../test_trt_convert_flatten_contiguous_range.py | 4 ++-- .../ir/inference/test_trt_convert_fused_token_prune.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_gather.py | 3 +-- .../unittests/ir/inference/test_trt_convert_gather_nd.py | 2 +- .../tests/unittests/ir/inference/test_trt_convert_gelu.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_group_norm.py | 4 ++-- .../ir/inference/test_trt_convert_hard_sigmoid.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_hard_swish.py | 4 ++-- .../ir/inference/test_trt_convert_instance_norm.py | 2 +- .../unittests/ir/inference/test_trt_convert_layer_norm.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_leaky_relu.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_matmul.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_matmul_v2.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_mish.py | 1 - .../ir/inference/test_trt_convert_multiclass_nms.py | 4 ++-- .../ir/inference/test_trt_convert_multiclass_nms3.py | 4 ++-- .../ir/inference/test_trt_convert_multihead_matmul.py | 2 +- .../ir/inference/test_trt_convert_nearest_interp.py | 4 +--- .../ir/inference/test_trt_convert_nearest_interp_v2.py | 5 ++--- .../tests/unittests/ir/inference/test_trt_convert_pad.py | 3 +-- .../unittests/ir/inference/test_trt_convert_pool2d.py | 2 +- .../ir/inference/test_trt_convert_preln_residual_bias.py | 4 ++-- .../inference/test_trt_convert_preln_residual_no_bias.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_prelu.py | 2 +- .../ir/inference/test_trt_convert_reduce_mean.py | 6 ++---- .../unittests/ir/inference/test_trt_convert_reduce_sum.py | 6 ++---- .../unittests/ir/inference/test_trt_convert_reshape.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_rnn.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_roi_align.py | 2 +- .../tests/unittests/ir/inference/test_trt_convert_roll.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_scale.py | 2 +- .../unittests/ir/inference/test_trt_convert_shape.py | 4 ++-- .../ir/inference/test_trt_convert_shuffle_channel.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_silu.py | 4 ++-- .../ir/inference/test_trt_convert_skip_layernorm.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_slice.py | 5 ++--- .../unittests/ir/inference/test_trt_convert_softmax.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_split.py | 2 +- .../unittests/ir/inference/test_trt_convert_squeeze2.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_stack.py | 4 ++-- .../ir/inference/test_trt_convert_strided_slice.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_sum.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_swish.py | 4 ++-- .../tests/unittests/ir/inference/test_trt_convert_tile.py | 7 +++---- .../unittests/ir/inference/test_trt_convert_top_k.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_top_k_v2.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_transpose.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_unary.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_unsqueeze2.py | 4 ++-- .../unittests/ir/inference/test_trt_convert_yolo_box.py | 2 +- .../unittests/ir/inference/test_trt_dynamic_shape.py | 1 - .../tests/unittests/ir/inference/test_trt_fc_fuse_pass.py | 2 -- .../ir/inference/test_trt_fc_fuse_quant_dequant_pass.py | 1 - .../ir/inference/test_trt_flatten2_matmul_fuse_pass.py | 5 ----- .../tests/unittests/ir/inference/test_trt_inspector.py | 4 ---- .../ir/inference/test_trt_matmul_quant_dequant.py | 1 - .../ir/inference/test_trt_shuffle_channel_detect_pass.py | 1 - .../ir/inference/test_trt_squeeze2_matmul_fuse_pass.py | 5 ----- .../ir/inference/test_trt_tuned_dynamic_shape.py | 2 +- .../ir/inference/test_unsqueeze2_eltwise_fuse_pass.py | 7 +------ .../tests/unittests/ir/inference/test_yolo_box_post.py | 1 - .../unittests/ir/inference/trt_layer_auto_scan_test.py | 2 +- python/paddle/fluid/tests/unittests/ir/pass_test.py | 4 +--- .../tests/unittests/ir/test_convert_to_mixed_precision.py | 1 - .../fluid/tests/unittests/ir/test_fuse_resnet_unit.py | 2 -- .../tests/unittests/ir/test_ir_graph_to_program_pass.py | 2 -- .../unittests/ir/test_ir_preln_residual_bias_fuse_pass.py | 1 - .../tests/unittests/ir/test_ir_skip_layernorm_pass.py | 1 - .../unittests/ir/test_ir_subgraph_python_interface.py | 3 +-- .../fluid/tests/unittests/ir/test_ir_yolo_box_pass.py | 1 - 192 files changed, 183 insertions(+), 543 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/bert_utils.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/bert_utils.py index c3cfb6c15b..3fb23049f1 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/bert_utils.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/bert_utils.py @@ -13,7 +13,6 @@ # limitations under the License. import numpy as np -import random SEED = 2020 diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/darknet.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/darknet.py index 58482bb977..d188c693ba 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/darknet.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/darknet.py @@ -17,7 +17,6 @@ from paddle.fluid.param_attr import ParamAttr from paddle.fluid.regularizer import L2Decay from paddle.fluid.dygraph.nn import Conv2D, BatchNorm -from paddle.fluid.dygraph.base import to_variable class ConvBNLayer(fluid.dygraph.Layer): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/decos.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/decos.py index 6e3333c15a..ee566fbcb3 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/decos.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/decos.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy import paddle from functools import wraps diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/predictor_utils.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/predictor_utils.py index 2772cff845..2759177e97 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/predictor_utils.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/predictor_utils.py @@ -13,10 +13,8 @@ # limitations under the License. import os -import unittest import numpy as np -import paddle import paddle.fluid as fluid from paddle.fluid.core import AnalysisConfig diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py index 2f1343563d..a18da2173f 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py @@ -16,7 +16,7 @@ import paddle.fluid as fluid import paddle.fluid.param_attr as attr from functools import reduce -from paddle.fluid.dygraph import declarative, to_variable +from paddle.fluid.dygraph import declarative from paddle.fluid.dygraph import Embedding, Layer, Linear from paddle.static import Variable diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_build_strategy.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_build_strategy.py index 300908a626..4746d35513 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_build_strategy.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_build_strategy.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import paddle import unittest import numpy as np from paddle.jit import ProgramTranslator -from test_resnet import ResNet, ResNetHelper +from test_resnet import ResNetHelper program_translator = ProgramTranslator() diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_convert_call_generator.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_convert_call_generator.py index a980a83e25..9a417cfe58 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_convert_call_generator.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_convert_call_generator.py @@ -14,14 +14,7 @@ import unittest -import logging -import numpy as np - import paddle -import paddle.fluid as fluid -from paddle.fluid.dygraph import ProgramTranslator -from paddle.fluid.dygraph.dygraph_to_static.convert_call_func import CONVERSION_OPTIONS -from test_program_translator import get_source_code from paddle.jit import to_static diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_cpu_cuda_to_tensor.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_cpu_cuda_to_tensor.py index 4b8be69f87..53149f758b 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_cpu_cuda_to_tensor.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_cpu_cuda_to_tensor.py @@ -14,7 +14,6 @@ import unittest import paddle -from paddle import fluid import numpy as np diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_jit_property_save.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_jit_property_save.py index 3874d6d27a..481d30b8ba 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_jit_property_save.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_jit_property_save.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy import unittest import paddle diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_lac.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_lac.py index 039146c75f..7ffbfbb653 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_lac.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_lac.py @@ -29,7 +29,7 @@ from paddle.fluid.dygraph import Embedding, Linear, GRUUnit from paddle.fluid.dygraph import declarative, ProgramTranslator from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX from paddle.fluid.framework import _non_static_mode -from paddle import _C_ops, _legacy_C_ops +from paddle import _legacy_C_ops SEED = 2020 diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist.py index 9241f05672..7d40749540 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist.py @@ -26,7 +26,6 @@ from paddle.fluid.dygraph import to_variable from paddle.fluid.dygraph.nn import Conv2D, Linear, Pool2D from paddle.fluid.optimizer import AdamOptimizer from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX -from paddle.fluid.dygraph.dygraph_to_static import ProgramTranslator from paddle.fluid.framework import _test_eager_guard from predictor_utils import PredictorTools diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_amp.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_amp.py index d682ef2929..56b55766af 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_amp.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_amp.py @@ -17,7 +17,6 @@ import unittest import numpy as np from time import time from test_mnist import MNIST, TestMNIST, SEED -from paddle.jit import ProgramTranslator from paddle.fluid.optimizer import AdamOptimizer if paddle.fluid.is_compiled_with_cuda(): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py index bc0742a789..beca9d3f93 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py @@ -12,14 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import paddle import unittest import numpy as np from time import time -from test_mnist import MNIST, TestMNIST, SEED, SimpleImgConvPool -from paddle.jit import ProgramTranslator -from paddle.fluid.optimizer import AdamOptimizer +from test_mnist import MNIST, SEED, TestMNIST if paddle.fluid.is_compiled_with_cuda(): paddle.fluid.set_flags({'FLAGS_cudnn_deterministic': True}) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_op_attr.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_op_attr.py index bf8252b56e..e6a3a74b06 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_op_attr.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_op_attr.py @@ -15,7 +15,6 @@ import six import paddle import unittest -import numpy as np from paddle.static import InputSpec diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_place.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_place.py index 0dc6c48f64..96cffc32a1 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_place.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_place.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np import paddle import unittest diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_program_translator.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_program_translator.py index 52e72f99f6..7bd415fdc8 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_program_translator.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_program_translator.py @@ -23,7 +23,6 @@ import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.dygraph_to_static import ProgramTranslator from paddle.fluid.dygraph.jit import declarative -from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.dygraph_to_static.utils import func_to_source_code import paddle.jit.dy2static as _jst diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet.py index 4902605808..86d215faad 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet.py @@ -22,7 +22,7 @@ import numpy as np import paddle import paddle.fluid as fluid -from paddle.fluid.dygraph import declarative, ProgramTranslator +from paddle.fluid.dygraph import ProgramTranslator from paddle.fluid.dygraph.nn import BatchNorm, Conv2D, Linear, Pool2D from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_amp.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_amp.py index ce57f3580d..c535b7223d 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_amp.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_amp.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import time import unittest @@ -20,8 +19,7 @@ import numpy as np import paddle import paddle.fluid as fluid -from paddle.fluid.dygraph import declarative, ProgramTranslator -from paddle.fluid.dygraph.nn import BatchNorm, Conv2D, Linear, Pool2D +from paddle.fluid.dygraph import ProgramTranslator from test_resnet import ResNet, optimizer_setting, SEED # NOTE: Reduce batch_size from 8 to 2 to avoid unittest timeout. diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_pure_fp16.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_pure_fp16.py index d3d663dde1..f4d724826a 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_pure_fp16.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_pure_fp16.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import time import unittest @@ -20,8 +19,7 @@ import numpy as np import paddle import paddle.fluid as fluid -from paddle.fluid.dygraph import declarative, ProgramTranslator -from paddle.fluid.dygraph.nn import BatchNorm, Conv2D, Linear, Pool2D +from paddle.fluid.dygraph import ProgramTranslator from test_resnet import ResNet, optimizer_setting, SEED # NOTE: Reduce batch_size from 8 to 2 to avoid unittest timeout. diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_save_inference_model.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_save_inference_model.py index f697e65cdc..60aa64abe6 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_save_inference_model.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_save_inference_model.py @@ -22,7 +22,7 @@ import paddle.fluid as fluid from paddle.fluid.dygraph.dygraph_to_static import ProgramTranslator from paddle.fluid.dygraph.jit import declarative from paddle.fluid.dygraph.dygraph_to_static.partial_program import partial_program_from -from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX, INFER_PARAMS_INFO_SUFFIX +from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX SEED = 2020 diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_setter_helper.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_setter_helper.py index 143694d933..0a5d567996 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_setter_helper.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_setter_helper.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle from paddle.fluid.dygraph.dygraph_to_static.utils import GetterSetterHelper vars = [1, 2, 3, 4, 5] diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_spec_names.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_spec_names.py index 7311fd285a..cfbf47a318 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_spec_names.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_spec_names.py @@ -14,7 +14,6 @@ import paddle from paddle.nn import Layer -import numpy as np import unittest diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_to_tensor.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_to_tensor.py index 8fb480c290..af543a5d97 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_to_tensor.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_to_tensor.py @@ -15,11 +15,7 @@ import numpy import paddle import unittest -import os -import tempfile -import paddle.inference as paddle_infer from paddle.fluid.framework import program_guard, Program -import numpy as np from paddle.fluid import core diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py index b14722ac71..6da285c01b 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py @@ -13,18 +13,15 @@ #limitations under the License. import argparse -import math import numpy as np import os import random import sys -import time import unittest import paddle import paddle.fluid as fluid from paddle.fluid.dygraph import declarative, ProgramTranslator, to_variable from paddle.fluid.dygraph.nn import Conv2D, BatchNorm, Linear, Pool2D -from paddle.fluid.layer_helper import LayerHelper from tsm_config_utils import * random.seed(0) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_typing.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_typing.py index cd2b7aa6e5..b55fb24219 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_typing.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_typing.py @@ -16,7 +16,7 @@ import tempfile import paddle import unittest import numpy as np -from typing import Tuple, List, Dict, TypeVar +from typing import Dict, List, Tuple class BaseLayer(paddle.nn.Layer): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_utils.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_utils.py index 55145676b4..30300ddf2e 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_utils.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_utils.py @@ -15,12 +15,9 @@ import types import unittest -from paddle.fluid.dygraph.dygraph_to_static import ProgramTranslator from paddle.fluid.dygraph.dygraph_to_static.utils import index_in_list from paddle.fluid.dygraph.dygraph_to_static.utils import is_paddle_func -from test_program_translator import get_source_code - class TestIndexInList(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_variable_trans_func.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_variable_trans_func.py index d5f5ae231e..9017789169 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_variable_trans_func.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_variable_trans_func.py @@ -12,12 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from paddle.utils import gast import unittest -import numpy as np -import paddle.fluid as fluid - from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code from paddle.fluid.dygraph.dygraph_to_static.variable_trans_func import create_fill_constant_node diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_warning.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_warning.py index 3c02f07e3c..846cb9e7aa 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_warning.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_warning.py @@ -15,7 +15,6 @@ import unittest import paddle import warnings -from paddle.fluid.dygraph.dygraph_to_static.program_translator import convert_to_static from paddle.fluid.layers.control_flow import cond diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_word2vec.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_word2vec.py index 0569865749..fbabe1bc36 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_word2vec.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_word2vec.py @@ -12,15 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import io -import os -import sys -import requests -from collections import OrderedDict import math import random import numpy as np -import paddle import paddle.fluid as fluid import unittest diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/tsm_config_utils.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/tsm_config_utils.py index 0b37e94b3a..3169311710 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/tsm_config_utils.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/tsm_config_utils.py @@ -12,7 +12,6 @@ #See the License for the specific language governing permissions and #limitations under the License. -import yaml import logging logger = logging.getLogger(__name__) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py index b652fbc24d..e502d78643 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py @@ -17,10 +17,7 @@ import sys import paddle.fluid as fluid from paddle.fluid.dygraph import declarative -from paddle.fluid.dygraph.base import to_variable -from paddle.fluid.dygraph.nn import Conv2D, BatchNorm -from paddle.fluid.initializer import Constant -from paddle.fluid.initializer import Normal +from paddle.fluid.dygraph.nn import Conv2D from paddle.fluid.param_attr import ParamAttr from paddle.fluid.regularizer import L2Decay diff --git a/python/paddle/fluid/tests/unittests/ir/inference/inference_pass_test.py b/python/paddle/fluid/tests/unittests/ir/inference/inference_pass_test.py index fb7da9736e..60980fbb73 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/inference_pass_test.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/inference_pass_test.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import six import random import unittest import numpy as np @@ -21,8 +19,6 @@ import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.core import PaddleTensor -from paddle.fluid.core import PaddleDType from paddle.fluid.core import AnalysisConfig from paddle.fluid.core import create_paddle_predictor diff --git a/python/paddle/fluid/tests/unittests/ir/inference/program_config.py b/python/paddle/fluid/tests/unittests/ir/inference/program_config.py index b01dd68143..abb353977b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/program_config.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/program_config.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Callable, Dict, List, Optional import numpy as np import enum import paddle diff --git a/python/paddle/fluid/tests/unittests/ir/inference/quant_dequant_test.py b/python/paddle/fluid/tests/unittests/ir/inference/quant_dequant_test.py index 4725a1dae8..c41e505332 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/quant_dequant_test.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/quant_dequant_test.py @@ -12,11 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import unittest import random import numpy as np -import six import paddle.fluid as fluid import paddle import warnings @@ -26,9 +24,8 @@ from paddle.fluid.contrib.slim.quantization import QuantizationFreezePass from paddle.fluid.contrib.slim.quantization import OutScaleForTrainingPass from paddle.fluid.contrib.slim.quantization import OutScaleForInferencePass from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass -from paddle.fluid import (core, Program, Variable, program_guard, layers) +from paddle.fluid import (core, Program, Variable) from paddle.fluid.io import prepend_feed_ops, append_fetch_ops -from inference_pass_test import InferencePassTest from paddle.fluid.core import create_paddle_predictor from paddle.fluid.core import AnalysisConfig diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_adaptive_pool2d_convert_global_pass_autoscan.py b/python/paddle/fluid/tests/unittests/ir/inference/test_adaptive_pool2d_convert_global_pass_autoscan.py index c24a90d508..aa2d29d613 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_adaptive_pool2d_convert_global_pass_autoscan.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_adaptive_pool2d_convert_global_pass_autoscan.py @@ -12,16 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_act_mkldnn_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_act_mkldnn_fuse_pass.py index 1696908f4e..4cef0a1518 100755 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_act_mkldnn_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_act_mkldnn_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bias_mkldnn_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bias_mkldnn_fuse_pass.py index 4b73a9f896..dd033b1178 100755 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bias_mkldnn_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bias_mkldnn_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bn_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bn_fuse_pass.py index e23089e789..0657ba51cd 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bn_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_bn_fuse_pass.py @@ -17,11 +17,8 @@ from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py index 8756625eaf..a540d94c63 100755 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py @@ -14,7 +14,6 @@ from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import unittest import os import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_fuse_pass.py index 5b33a18af8..303c8017e9 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_fuse_pass.py @@ -17,11 +17,8 @@ from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_bn_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_bn_fuse_pass.py index 008d19356f..4349d5d47d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_bn_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_bn_fuse_pass.py @@ -16,13 +16,7 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import copy as cp -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set -import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_eltwiseadd_bn_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_eltwiseadd_bn_fuse_pass.py index cba1ce4a85..bdbe057ff2 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_eltwiseadd_bn_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_conv_transpose_eltwiseadd_bn_fuse_pass.py @@ -16,13 +16,7 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import copy as cp -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set -import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_delete_c_identity_op_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_delete_c_identity_op_pass.py index 36f794d0f9..7efe5e9718 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_delete_c_identity_op_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_delete_c_identity_op_pass.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import paddle.inference as paddle_infer diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_emb_eltwise_layernorm_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_emb_eltwise_layernorm_fuse_pass.py index e8e5e576f1..87e894cda0 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_emb_eltwise_layernorm_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_emb_eltwise_layernorm_fuse_pass.py @@ -17,11 +17,8 @@ from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_elementwise_layernorm_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_elementwise_layernorm_fuse_pass.py index a2d8213de7..3bd6fabfd1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_elementwise_layernorm_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_elementwise_layernorm_fuse_pass.py @@ -12,16 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_fuse_pass.py index 86262aaee1..662acf9358 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_fuse_pass.py @@ -16,12 +16,8 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_gru_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_gru_fuse_pass.py index 3da1516e97..b722fb798c 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_gru_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_gru_fuse_pass.py @@ -16,7 +16,6 @@ import unittest import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid -import paddle.fluid.core as core from paddle.fluid.core import PassVersionChecker diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_lstm_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_lstm_fuse_pass.py index 4db2c5f96c..040cf05b02 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_fc_lstm_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_fc_lstm_fuse_pass.py @@ -16,7 +16,6 @@ import unittest import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid -import paddle.fluid.core as core from paddle.fluid.core import PassVersionChecker diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_flatten2_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_flatten2_matmul_fuse_pass.py index 17401e61f1..da27ae739f 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_flatten2_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_flatten2_matmul_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py index f7265193a8..e97eac1652 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import paddle.inference as paddle_infer diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_layer_norm_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_layer_norm_fuse_pass.py index a56ce98b37..81e12958f0 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_layer_norm_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_layer_norm_fuse_pass.py @@ -15,13 +15,8 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_layernorm_shift_partition_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_layernorm_shift_partition_pass.py index d74e90fa5f..0daebab21d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_layernorm_shift_partition_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_layernorm_shift_partition_pass.py @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_to_mul_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_to_mul_pass.py index ab1a61bcc5..0f1b2b2056 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_to_mul_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_to_mul_pass.py @@ -14,14 +14,8 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_matmul_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_matmul_pass.py index c16e140838..a171d499ca 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_matmul_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_matmul_pass.py @@ -14,14 +14,8 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_mul_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_mul_pass.py index 77422428ca..71bd77c7b1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_mul_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_v2_to_mul_pass.py @@ -14,14 +14,8 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_scale_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_scale_fuse_pass.py index 2dd25c687f..e3597e13c5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_scale_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_scale_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_v2_scale_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_v2_scale_fuse_pass.py index a02f460280..ef5406c7bc 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_v2_scale_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_matmul_v2_scale_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_batch_norm_act_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_batch_norm_act_fuse_pass.py index 6c17db2caa..63bb9e7256 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_batch_norm_act_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_batch_norm_act_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py index 3556e5ef33..21d3234929 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_op.py index 7f75f8ddf4..22454e55a1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_op.py @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import MkldnnAutoScanTest, SkipReasons +from auto_scan_test import MkldnnAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_affine_channel_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_affine_channel_fuse_pass.py index 89595f9081..94b9ac66a3 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_affine_channel_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_affine_channel_fuse_pass.py @@ -15,13 +15,9 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_bias_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_bias_fuse_pass.py index 0dd903a487..7a1a04ca06 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_bias_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_bias_fuse_pass.py @@ -16,8 +16,6 @@ import unittest import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid -import paddle.fluid.core as core -from paddle.fluid.core import AnalysisConfig from paddle.fluid.core import PassVersionChecker diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_elementwise_add_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_elementwise_add_fuse_pass.py index 44b1e8bf06..3d0ca34a5e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_elementwise_add_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_elementwise_add_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_gelu_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_gelu_fuse_pass.py index dff23e96dd..3abb582365 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_gelu_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_gelu_fuse_pass.py @@ -12,17 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest import paddle -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_sigmoid_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_sigmoid_fuse_pass.py index 1eb325f1d0..010d3e8f3a 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_sigmoid_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_sigmoid_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_swish_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_swish_fuse_pass.py index a0ed73964f..799d1cbaa1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_swish_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_hard_swish_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_transpose_bias_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_transpose_bias_fuse_pass.py index a05cbf5ba3..2eebd52955 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_transpose_bias_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv_transpose_bias_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_depthwise_conv_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_depthwise_conv_pass.py index bfe2f7d035..ebfb0270f6 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_depthwise_conv_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_depthwise_conv_pass.py @@ -16,13 +16,7 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import copy as cp -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set -import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_elt_act_fuse_pass_new.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_elt_act_fuse_pass_new.py index 78393ef59b..feef212b1f 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_elt_act_fuse_pass_new.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_elt_act_fuse_pass_new.py @@ -15,12 +15,9 @@ from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_fc_elementwise_add_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_fc_elementwise_add_fuse_pass.py index 61492b1d05..d69a7b8a8b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_fc_elementwise_add_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_fc_elementwise_add_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_inplace_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_inplace_fuse_pass.py index 63a5de8475..6b589821ba 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_inplace_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_inplace_fuse_pass.py @@ -17,8 +17,6 @@ import numpy as np from inference_pass_test import InferencePassTest import paddle import paddle.fluid as fluid -import paddle.fluid.core as core -from paddle.fluid.core import AnalysisConfig from paddle.fluid.core import PassVersionChecker diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_transpose_reshape_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_transpose_reshape_fuse_pass.py index c8fb49c10c..56825149dd 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_transpose_reshape_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_transpose_reshape_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_v2_transpose_reshape_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_v2_transpose_reshape_fuse_pass.py index 0e24c4a394..42f349cf4a 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_v2_transpose_reshape_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmul_v2_transpose_reshape_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmulv2_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmulv2_op.py index c144830904..06829c2d78 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmulv2_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_matmulv2_op.py @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import MkldnnAutoScanTest, SkipReasons +from auto_scan_test import MkldnnAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad2d_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad2d_op.py index 5a81451feb..e26cf2a860 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad2d_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad2d_op.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np from functools import partial import unittest -from hypothesis import given, reproduce_failure +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad3d_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad3d_op.py index acc7fa1e30..8184bb149e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad3d_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_pad3d_op.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np from functools import partial import unittest -from hypothesis import given, reproduce_failure +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_prelu_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_prelu_op.py index 3dde53d84a..646cf1170e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_prelu_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_prelu_op.py @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import MkldnnAutoScanTest, SkipReasons +from auto_scan_test import MkldnnAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_fuse_pass.py index ce1ea51cb8..62615ce54c 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st from functools import reduce diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_v2_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_v2_fuse_pass.py index 1e4ae8f87a..9d6c0309e1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_v2_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_reshape_transpose_matmul_v2_fuse_pass.py @@ -17,8 +17,6 @@ import numpy as np from inference_pass_test import InferencePassTest import paddle import paddle.fluid as fluid -import paddle.fluid.core as core -from paddle.fluid.core import AnalysisConfig from paddle.fluid.core import PassVersionChecker diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_scale_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_scale_matmul_fuse_pass.py index f29e20f6b8..c12915c1eb 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_scale_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_scale_matmul_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_shuffle_channel_detect_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_shuffle_channel_detect_pass.py index 74c3c34212..423bb0f0db 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_shuffle_channel_detect_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_shuffle_channel_detect_pass.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np from functools import partial import unittest -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mul_gru_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mul_gru_fuse_pass.py index b1cf07776e..54f6b60ff8 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mul_gru_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mul_gru_fuse_pass.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestMulGruFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_mul_lstm_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_mul_lstm_fuse_pass.py index 959c75d53d..2d65a7fad5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_mul_lstm_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_mul_lstm_fuse_pass.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestMulLstmFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_multihead_matmul_fuse_pass_v3.py b/python/paddle/fluid/tests/unittests/ir/inference/test_multihead_matmul_fuse_pass_v3.py index dcb90358fe..c59da1a891 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_multihead_matmul_fuse_pass_v3.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_multihead_matmul_fuse_pass_v3.py @@ -12,18 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure -import hypothesis.strategies as st - class TestMultiheadMatmulFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_repeated_fc_relu_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_repeated_fc_relu_fuse_pass.py index f112ccca87..f0cb8797f4 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_repeated_fc_relu_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_repeated_fc_relu_fuse_pass.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestRepeatedFcReluFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_reshape2_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_reshape2_matmul_fuse_pass.py index 18cc733476..b1311b1298 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_reshape2_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_reshape2_matmul_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_seq_concat_fc_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_seq_concat_fc_fuse_pass.py index de0aed5e20..53dc65f84b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_seq_concat_fc_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_seq_concat_fc_fuse_pass.py @@ -15,15 +15,10 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestSeqConcatFcFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_seqconv_eltadd_relu_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_seqconv_eltadd_relu_fuse_pass.py index 4140eb32bb..ee5bb892b9 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_seqconv_eltadd_relu_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_seqconv_eltadd_relu_fuse_pass.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestSeqconvEltaddReluFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_seqpool_cvm_concat_fuse_pass_py.py b/python/paddle/fluid/tests/unittests/ir/inference/test_seqpool_cvm_concat_fuse_pass_py.py index 53333da57e..d768b1c23f 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_seqpool_cvm_concat_fuse_pass_py.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_seqpool_cvm_concat_fuse_pass_py.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st -from functools import reduce class TestSeqpoolCvmConcatFusePass(PassAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_shuffle_channel_detect_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_shuffle_channel_detect_pass.py index 1bcaa4d43e..669b1906d2 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_shuffle_channel_detect_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_shuffle_channel_detect_pass.py @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_simplify_with_basic_ops_pass_autoscan.py b/python/paddle/fluid/tests/unittests/ir/inference/test_simplify_with_basic_ops_pass_autoscan.py index 1d279a2313..6dab206551 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_simplify_with_basic_ops_pass_autoscan.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_simplify_with_basic_ops_pass_autoscan.py @@ -12,16 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_squared_mat_sub_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_squared_mat_sub_fuse_pass.py index 4b9ba91da4..93a6e0fa32 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_squared_mat_sub_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_squared_mat_sub_fuse_pass.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig import numpy as np -import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_squeeze2_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_squeeze2_matmul_fuse_pass.py index 466bb5b710..ea4fee32a3 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_squeeze2_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_squeeze2_matmul_fuse_pass.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np -import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_transpose_flatten_concat_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_transpose_flatten_concat_fuse_pass.py index 5121cbda8d..dfd80ee7f7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_transpose_flatten_concat_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_transpose_flatten_concat_fuse_pass.py @@ -12,14 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, IgnoreReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_anchor_generator_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_anchor_generator_op.py index ef4323dcda..7e22604a37 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_anchor_generator_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_anchor_generator_op.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import itertools import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_c_allreduce_infer_script.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_c_allreduce_infer_script.py index 5d96fa8c81..e90157c928 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_c_allreduce_infer_script.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_c_allreduce_infer_script.py @@ -18,8 +18,6 @@ import numpy as np import tempfile import paddle import paddle.distributed.fleet as fleet -from paddle.distributed import ReduceOp -from paddle.distributed import init_parallel_env from paddle.inference import Config from paddle.inference import create_predictor from paddle.inference import PrecisionType diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_op.py index 2fdacdc1e4..088b548f01 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_op.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import shutil import unittest import numpy as np from inference_pass_test import InferencePassTest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_transpose_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_transpose_op.py index 6ada9edd18..0cd4bd1a8e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_transpose_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv3d_transpose_op.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import shutil import unittest import numpy as np from inference_pass_test import InferencePassTest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_pass.py index 3a16f4f7d5..5e163bce40 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_pass.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import shutil import unittest import numpy as np from inference_pass_test import InferencePassTest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_quant_dequant_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_quant_dequant_pass.py index a726e2cd06..fbaf6944be 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_quant_dequant_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_conv_quant_dequant_pass.py @@ -12,11 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import shutil import unittest import numpy as np -from inference_pass_test import InferencePassTest from quant_dequant_test import QuantDequantTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py index 82b73609b2..e611c6cc39 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertActivationTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py index deeffe9967..34b033b4b7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertAffineChannelTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_anchor_generator.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_anchor_generator.py index 0a2877b9a2..3df768480c 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_anchor_generator.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_anchor_generator.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_batch_norm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_batch_norm.py index 6682993c83..88d13c062a 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_batch_norm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_batch_norm.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertBatchNormTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_bilinear_interp_v2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_bilinear_interp_v2.py index 3fe041db93..83559d4fe8 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_bilinear_interp_v2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_bilinear_interp_v2.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_c_allreduce.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_c_allreduce.py index 8aae2d7375..a9f1964e49 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_c_allreduce.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_c_allreduce.py @@ -13,8 +13,6 @@ # limitations under the License. import subprocess -import sys -import pickle import os import unittest import paddle diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_cast.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_cast.py index 8dca14c02a..5c915db725 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_cast.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_cast.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List class TrtConvertCastTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_clip.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_clip.py index aec2f3efd4..27d55431c6 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_clip.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_clip.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_concat.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_concat.py index e8c9a65bbf..1cab2ee3f7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_concat.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_concat.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertConcatTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d.py index 4d8f4e2b19..0682477357 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d.py @@ -15,10 +15,10 @@ import unittest import itertools from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import numpy as np import paddle.inference as paddle_infer -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_fusion.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_fusion.py index 9ac0bbd470..420b3a5cfa 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_fusion.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_fusion.py @@ -15,11 +15,11 @@ import unittest from itertools import product from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import numpy as np import paddle.inference as paddle_infer from program_config import TensorConfig, ProgramConfig -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest class TrtConvertConv2dFusionTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_transpose.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_transpose.py index ce69d9d739..9085ba029b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_transpose.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_transpose.py @@ -18,7 +18,7 @@ import numpy as np import unittest import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertConv2dTransposeTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv3d_transpose.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv3d_transpose.py index 3852254a53..a19405cdec 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv3d_transpose.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv3d_transpose.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import unittest import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List # Special case diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_deformable_conv.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_deformable_conv.py index d0d8e35fdd..f50f170487 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_deformable_conv.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_deformable_conv.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py index 431b3c27e4..417849ded5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_dropout.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_dropout.py index 5d8e93ef98..14f39dc67d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_dropout.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_dropout.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertDropoutTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py index 5a1cc19c61..c34cfcac6e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List # This is the special test case with weight including batch dimension diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_emb_eltwise_layernorm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_emb_eltwise_layernorm.py index 36b63be345..12b80e09a5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_emb_eltwise_layernorm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_emb_eltwise_layernorm.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_equal.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_equal.py index 285ac3f220..2261658dd3 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_equal.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_equal.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List class TrtConvertElementwiseTest_one_input_corner_case(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fc.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fc.py index 0eb88b5c01..3434181107 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fc.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fc.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import unittest import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fill_constant.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fill_constant.py index cc686be6d8..568d73a432 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fill_constant.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fill_constant.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertSplitTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py index e9f9b70b91..fea4b3afc1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten_contiguous_range.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten_contiguous_range.py index 42b4398282..e39d8bf10e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten_contiguous_range.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten_contiguous_range.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List class TrtConvertFlattenContiguousRangeTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fused_token_prune.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fused_token_prune.py index 7cf163916b..287f0af082 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fused_token_prune.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_fused_token_prune.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py index 25d0d48c8c..25fd21e4d7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py @@ -17,8 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set -import logging +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py index 75b5cba9e8..7bb980d459 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py index 29f656130f..8467614fe5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py index 6115ae60ef..be3961bdff 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_sigmoid.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_sigmoid.py index 0980acccb8..d99fc41385 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_sigmoid.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_sigmoid.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_swish.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_swish.py index 220611517e..2acd5e335d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_swish.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_hard_swish.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_instance_norm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_instance_norm.py index 99c34a587b..135858fec7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_instance_norm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_instance_norm.py @@ -18,7 +18,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_layer_norm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_layer_norm.py index 4eb18c2de3..f6e4dec953 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_layer_norm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_layer_norm.py @@ -13,12 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_leaky_relu.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_leaky_relu.py index 7f33cfc64a..db7b14f3da 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_leaky_relu.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_leaky_relu.py @@ -13,12 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul.py index 76fcffad45..3004d14adb 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul_v2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul_v2.py index d895872db4..a91ed595ba 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul_v2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_matmul_v2.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_mish.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_mish.py index 0dd003487c..d6d62967cf 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_mish.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_mish.py @@ -17,7 +17,6 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms.py index f554955786..e52eb4d1ce 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms3.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms3.py index c0b659b41b..7b743b00b3 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms3.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multiclass_nms3.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multihead_matmul.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multihead_matmul.py index d552692ae4..6e5cf90bab 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multihead_matmul.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_multihead_matmul.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List class TrtConvertMultiHeadMatmulTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp.py index 7cefcb96a3..71893db5e5 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest @@ -135,8 +135,6 @@ class TrtConvertNearestInterpTest(TrtLayerAutoScanTest): "NOT Implemented: we need to add support scale <= 0 in dynamic shape in the future" ) - pass - def test(self): self.add_skip_trt_case() self.run_test() diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp_v2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp_v2.py index 2cd4253cb8..a8156e37f9 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp_v2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_nearest_interp_v2.py @@ -12,12 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pad.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pad.py index 767854b0fb..dafb789618 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pad.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pad.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest @@ -128,7 +128,6 @@ class TrtConvertPadTest(TrtLayerAutoScanTest): teller1, SkipReasons.TRT_NOT_IMPLEMENTED, "NOT Implemented: we need to add support pad not only inplement on h or w, such as paddings = [0, 0, 1, 1, 1, 1, 1, 1]" ) - pass def test(self): self.add_skip_trt_case() diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py index b543484d89..49d24e863c 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_pool2d.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest import itertools diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_bias.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_bias.py index 8e6d1fb58d..284fd9231d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_bias.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_bias.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_no_bias.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_no_bias.py index de6f10bf6c..74582cffb7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_no_bias.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_preln_residual_no_bias.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py index 660afecaaa..0bc26954f0 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_mean.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_mean.py index dc5696a9b7..95c9e24dca 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_mean.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_mean.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest @@ -139,8 +139,6 @@ class TrtConvertReduceMeanTest(TrtLayerAutoScanTest): yield self.create_inference_config(), generate_trt_nodes_num( attrs, True), (5e-4, 5e-4) - pass - def add_skip_trt_case(self): pass diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py index 42b234827b..37280207cb 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest @@ -134,8 +134,6 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest): yield self.create_inference_config(), generate_trt_nodes_num( attrs, True), (1e-4, 1e-4) - pass - def add_skip_trt_case(self): pass diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py index 7902a35a9a..1994947147 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_rnn.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_rnn.py index a6000b1256..2b76e273aa 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_rnn.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_rnn.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roi_align.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roi_align.py index ca12fe876c..72f52dda69 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roi_align.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roi_align.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertRoiAlignTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roll.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roll.py index 675054317d..391aa84bc1 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roll.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_roll.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py index 7f44e35603..33a7c060ec 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shape.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shape.py index 610f4a9425..5367167e28 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shape.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shape.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py index a53b61a007..06a37ea19a 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_silu.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_silu.py index 2b5ac81e30..3b9ff8a052 100755 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_silu.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_silu.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_skip_layernorm.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_skip_layernorm.py index 145a5df781..3a3b0603ec 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_skip_layernorm.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_skip_layernorm.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_slice.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_slice.py index deac7ef9d2..bed6e5e96e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_slice.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_slice.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest @@ -144,7 +144,6 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest): # trt6 and trt7.1 has bug. # trt7.2 deserialize has bug. self.run_test() - pass if __name__ == "__main__": diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_softmax.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_softmax.py index 6a65382baf..6662146331 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_softmax.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_softmax.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertSoftmaxTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_split.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_split.py index e8c283acc3..ad1ca6ff2e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_split.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_split.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertSplitTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_squeeze2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_squeeze2.py index f82791a591..2e4e5fb3b8 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_squeeze2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_squeeze2.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertSplitTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_stack.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_stack.py index cfae56fc2b..7d35ddc68b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_stack.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_stack.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_strided_slice.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_strided_slice.py index beea119c79..aea3f6e55d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_strided_slice.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_strided_slice.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_sum.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_sum.py index a982a26362..c15c6068dc 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_sum.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_sum.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py index 2d667d645c..1b5398bb48 100755 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_tile.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_tile.py index 82c707869f..e5b9344980 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_tile.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_tile.py @@ -12,16 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume +from hypothesis import given import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k.py index 28509d42ee..1053cd221e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertActivationTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k_v2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k_v2.py index 651cc00d2c..8eb9dc2b6e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k_v2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_top_k_v2.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertActivationTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py index e9604925e4..dde615df09 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unary.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unary.py index ca4231a356..9710a3e1aa 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unary.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unary.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertActivationTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unsqueeze2.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unsqueeze2.py index fc99da714f..baaa7168aa 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unsqueeze2.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_unsqueeze2.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from trt_layer_auto_scan_test import TrtLayerAutoScanTest from program_config import TensorConfig, ProgramConfig import unittest import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List class TrtConvertSplitTest(TrtLayerAutoScanTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box.py index ddab5b8c52..ed9bb722a8 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box.py @@ -17,7 +17,7 @@ from program_config import TensorConfig, ProgramConfig import numpy as np import paddle.inference as paddle_infer from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set +from typing import Any, Dict, List import unittest import os diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_dynamic_shape.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_dynamic_shape.py index 7de8782ed4..ae5f9f9467 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_dynamic_shape.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_dynamic_shape.py @@ -17,7 +17,6 @@ import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.core import PassVersionChecker from paddle.fluid.core import AnalysisConfig diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_pass.py index b4f4730d48..78436f644b 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_pass.py @@ -15,11 +15,9 @@ import unittest import numpy as np from inference_pass_test import InferencePassTest -from quant_dequant_test import QuantDequantTest import paddle.fluid as fluid import paddle.fluid.core as core from paddle.fluid.core import AnalysisConfig -from paddle.fluid.core import PassVersionChecker class FCFusePassTRTTest(InferencePassTest): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_quant_dequant_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_quant_dequant_pass.py index f7291bfb60..847c836972 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_quant_dequant_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_fc_fuse_quant_dequant_pass.py @@ -14,7 +14,6 @@ import unittest import numpy as np -from inference_pass_test import InferencePassTest from quant_dequant_test import QuantDequantTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_flatten2_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_flatten2_matmul_fuse_pass.py index dee1102e9d..14f50e280e 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_flatten2_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_flatten2_matmul_fuse_pass.py @@ -14,14 +14,9 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_inspector.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_inspector.py index c69e0c98a4..2aba345ffc 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_inspector.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_inspector.py @@ -13,16 +13,12 @@ # limitations under the License. import sys -import os -import threading -import time import unittest import numpy as np from inference_pass_test import InferencePassTest import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.core import PassVersionChecker from paddle.fluid.core import AnalysisConfig import subprocess diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_matmul_quant_dequant.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_matmul_quant_dequant.py index baf02fc423..b075c65c82 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_matmul_quant_dequant.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_matmul_quant_dequant.py @@ -14,7 +14,6 @@ import unittest import numpy as np -from inference_pass_test import InferencePassTest from quant_dequant_test import QuantDequantTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_shuffle_channel_detect_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_shuffle_channel_detect_pass.py index ced6c70659..0752599e76 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_shuffle_channel_detect_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_shuffle_channel_detect_pass.py @@ -16,7 +16,6 @@ import unittest import numpy as np from inference_pass_test import InferencePassTest import paddle.fluid as fluid -import paddle.fluid.core as core from paddle.fluid.core import PassVersionChecker from paddle.fluid.core import AnalysisConfig diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_squeeze2_matmul_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_squeeze2_matmul_fuse_pass.py index 9fd1dd2bf4..e56c3b3d79 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_squeeze2_matmul_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_squeeze2_matmul_fuse_pass.py @@ -14,14 +14,9 @@ from auto_scan_test import PassAutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_tuned_dynamic_shape.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_tuned_dynamic_shape.py index 7bace66cab..3ef7ca22ac 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_tuned_dynamic_shape.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_tuned_dynamic_shape.py @@ -18,7 +18,7 @@ import paddle paddle.enable_static() import paddle.fluid as fluid -from paddle.inference import Config, Predictor, create_predictor +from paddle.inference import Config, create_predictor class TRTTunedDynamicShapeTest(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_unsqueeze2_eltwise_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/inference/test_unsqueeze2_eltwise_fuse_pass.py index a850e9602d..698f8d772a 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_unsqueeze2_eltwise_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_unsqueeze2_eltwise_fuse_pass.py @@ -12,16 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import PassAutoScanTest, SkipReasons +from auto_scan_test import PassAutoScanTest from program_config import TensorConfig, ProgramConfig, OpConfig -import numpy as np import paddle.inference as paddle_infer -from functools import partial -from typing import Optional, List, Callable, Dict, Any, Set import unittest -import hypothesis -from hypothesis import given, settings, seed, example, assume, reproduce_failure import hypothesis.strategies as st diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_yolo_box_post.py b/python/paddle/fluid/tests/unittests/ir/inference/test_yolo_box_post.py index b009152071..74f251ec62 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_yolo_box_post.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_yolo_box_post.py @@ -15,7 +15,6 @@ import unittest import numpy as np import paddle -from paddle.fluid import core from paddle.fluid.layer_helper import LayerHelper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/ir/inference/trt_layer_auto_scan_test.py b/python/paddle/fluid/tests/unittests/ir/inference/trt_layer_auto_scan_test.py index 7432101e78..c2378787e7 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/trt_layer_auto_scan_test.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/trt_layer_auto_scan_test.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import TrtLayerAutoScanTest, SkipReasons +from auto_scan_test import TrtLayerAutoScanTest, SkipReasons # noqa: F401 diff --git a/python/paddle/fluid/tests/unittests/ir/pass_test.py b/python/paddle/fluid/tests/unittests/ir/pass_test.py index ac76884607..37b9dcf546 100644 --- a/python/paddle/fluid/tests/unittests/ir/pass_test.py +++ b/python/paddle/fluid/tests/unittests/ir/pass_test.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import six import random import unittest @@ -21,8 +20,7 @@ import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.core as core -from paddle.fluid.framework import Program, Block -from paddle.fluid.backward import append_backward +from paddle.fluid.framework import Block class PassTest(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/ir/test_convert_to_mixed_precision.py b/python/paddle/fluid/tests/unittests/ir/test_convert_to_mixed_precision.py index deb4990cf5..333859f20d 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_convert_to_mixed_precision.py +++ b/python/paddle/fluid/tests/unittests/ir/test_convert_to_mixed_precision.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from paddle.vision.models import resnet50 diff --git a/python/paddle/fluid/tests/unittests/ir/test_fuse_resnet_unit.py b/python/paddle/fluid/tests/unittests/ir/test_fuse_resnet_unit.py index 40697f0a6e..58b227f4cb 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_fuse_resnet_unit.py +++ b/python/paddle/fluid/tests/unittests/ir/test_fuse_resnet_unit.py @@ -17,8 +17,6 @@ import numpy as np import paddle import paddle.incubate from paddle.fluid import core -from paddle.vision.models import ResNet -from paddle.vision.models.resnet import BottleneckBlock, BasicBlock paddle.enable_static() np.random.seed(0) diff --git a/python/paddle/fluid/tests/unittests/ir/test_ir_graph_to_program_pass.py b/python/paddle/fluid/tests/unittests/ir/test_ir_graph_to_program_pass.py index 1815fe16fd..c4f9147e33 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_ir_graph_to_program_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/test_ir_graph_to_program_pass.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import unittest -import six import paddle from paddle import fluid from paddle import static diff --git a/python/paddle/fluid/tests/unittests/ir/test_ir_preln_residual_bias_fuse_pass.py b/python/paddle/fluid/tests/unittests/ir/test_ir_preln_residual_bias_fuse_pass.py index efa5da7da3..a8d2cdc01c 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_ir_preln_residual_bias_fuse_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/test_ir_preln_residual_bias_fuse_pass.py @@ -14,7 +14,6 @@ import unittest -import numpy as np from pass_test import PassTest import paddle diff --git a/python/paddle/fluid/tests/unittests/ir/test_ir_skip_layernorm_pass.py b/python/paddle/fluid/tests/unittests/ir/test_ir_skip_layernorm_pass.py index 25b5fa6ffb..d53e7109d6 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_ir_skip_layernorm_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/test_ir_skip_layernorm_pass.py @@ -14,7 +14,6 @@ import unittest -import numpy as np from pass_test import PassTest import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/ir/test_ir_subgraph_python_interface.py b/python/paddle/fluid/tests/unittests/ir/test_ir_subgraph_python_interface.py index 3f8703b657..07be10deaa 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_ir_subgraph_python_interface.py +++ b/python/paddle/fluid/tests/unittests/ir/test_ir_subgraph_python_interface.py @@ -18,11 +18,10 @@ import paddle.fluid as fluid import six from paddle.fluid.framework import IrGraph -from paddle.fluid.framework import IrNode from paddle.fluid.tests.unittests.op_test import OpTestTool from paddle.fluid import core import paddle.fluid.layers as layers -from paddle.fluid.framework import Program, program_guard, default_startup_program +from paddle.fluid.framework import Program, program_guard from paddle.fluid.contrib.slim.quantization import QuantizationTransformPass paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/ir/test_ir_yolo_box_pass.py b/python/paddle/fluid/tests/unittests/ir/test_ir_yolo_box_pass.py index b710436a51..e86327f62f 100644 --- a/python/paddle/fluid/tests/unittests/ir/test_ir_yolo_box_pass.py +++ b/python/paddle/fluid/tests/unittests/ir/test_ir_yolo_box_pass.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from paddle.fluid import core from paddle.fluid.layer_helper import LayerHelper -- GitLab