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 c3cfb6c15ba..3fb23049f1b 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 58482bb9771..d188c693baa 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 6e3333c15a0..ee566fbcb33 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 2772cff8459..2759177e978 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 2f1343563d9..a18da2173fe 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 300908a626b..4746d355134 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 a980a83e255..9a417cfe585 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 4b8be69f87e..53149f758ba 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 3874d6d27a1..481d30b8ba2 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 039146c75f8..7ffbfbb6533 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 9241f05672f..7d407495402 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 d682ef29296..56b55766af6 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 bc0742a7898..beca9d3f933 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 bf8252b56ea..e6a3a74b060 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 0dc6c48f645..96cffc32a19 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 52e72f99f61..7bd415fdc8a 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 49026058084..86d215faadd 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 ce57f3580d1..c535b7223db 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 d3d663dde1d..f4d724826ab 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 f697e65cdc5..60aa64abe66 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 143694d933b..0a5d567996d 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 7311fd285ab..cfbf47a318f 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 8fb480c2907..af543a5d97b 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 b14722ac712..6da285c01b3 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 cd2b7aa6e53..b55fb242199 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 55145676b45..30300ddf2e4 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 d5f5ae231eb..90177891693 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 3c02f07e3cc..846cb9e7aa1 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 05698657492..fbabe1bc36b 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 0b37e94b3a2..3169311710e 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 b652fbc24dc..e502d786430 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 fb7da9736e6..60980fbb732 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 b01dd68143d..abb353977b4 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 4725a1dae8b..c41e505332f 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 c24a90d5084..aa2d29d6137 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 1696908f4e7..4cef0a1518c 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 4b73a9f896e..dd033b11783 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 e23089e7895..0657ba51cdc 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 8756625eaf1..a540d94c630 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 5b33a18af8e..303c8017e95 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 008d19356f5..4349d5d47d9 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 cba1ce4a85f..bdbe057ff22 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 36f794d0f95..7efe5e97180 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 e8e5e576f1b..87e894cda06 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 a2d8213de72..3bd6fabfd19 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 86262aaee10..662acf93583 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 3da1516e974..b722fb798c5 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 4db2c5f96cd..040cf05b02a 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 17401e61f10..da27ae739fe 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 f7265193a85..e97eac16528 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 a56ce98b37a..81e12958f03 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 d74e90fa5f2..0daebab21d5 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 ab1a61bcc51..0f1b2b20568 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 c16e1408387..a171d499cab 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 77422428ca5..71bd77c7b14 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 2dd25c687fe..e3597e13c58 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 a02f460280c..ef5406c7bca 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 6c17db2caa4..63bb9e7256d 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 3556e5ef334..21d32349290 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 7f75f8ddf4f..22454e55a13 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 89595f90817..94b9ac66a3d 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 0dd903a487c..7a1a04ca06f 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 44b1e8bf064..3d0ca34a5e0 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 dff23e96dd2..3abb582365b 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 1eb325f1d08..010d3e8f3aa 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 a0ed73964f3..799d1cbaa1c 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 a05cbf5ba35..2eebd529554 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 bfe2f7d0350..ebfb0270f67 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 78393ef59b6..feef212b1f6 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 61492b1d05d..d69a7b8a8bc 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 63a5de84750..6b589821ba8 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 c8fb49c10c1..56825149dd2 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 0e24c4a394f..42f349cf4ae 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 c144830904a..06829c2d78b 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 5a81451febf..e26cf2a8605 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 acc7fa1e30e..8184bb149e1 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 3dde53d84aa..646cf1170ee 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 ce1ea51cb84..62615ce54c8 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 1e4ae8f87a5..9d6c0309e17 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 f29e20f6b8d..c12915c1eb1 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 74c3c34212f..423bb0f0dbb 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 b1cf07776ef..54f6b60ff86 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 959c75d53db..2d65a7fad5e 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 dcb90358fe3..c59da1a8913 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 f112ccca878..f0cb8797f4e 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 18cc733476e..b1311b12983 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 de0aed5e204..53dc65f84b5 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 4140eb32bb8..ee5bb892b94 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 53333da57e7..d768b1c23ff 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 1bcaa4d43e7..669b1906d2c 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 1d279a2313f..6dab206551c 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 4b9ba91da49..93a6e0fa322 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 466bb5b7100..ea4fee32a3e 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 5121cbda8d8..dfd80ee7f79 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 ef4323dcda5..7e22604a374 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 5d96fa8c816..e90157c928c 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 2fdacdc1e4e..088b548f018 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 6ada9edd18e..0cd4bd1a8e9 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 3a16f4f7d55..5e163bce407 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 a726e2cd061..fbaf6944be9 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 82b73609b2e..e611c6cc39e 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 deeffe99674..34b033b4b7c 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 0a2877b9a23..3df768480c4 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 6682993c83c..88d13c062a5 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 3fe041db933..83559d4fe86 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 8aae2d73753..a9f1964e49a 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 8dca14c02aa..5c915db7250 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 aec2f3efd4f..27d55431c6d 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 e8c9a65bbfc..1cab2ee3f7d 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 4d8f4e2b195..0682477357e 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 9ac0bbd470b..420b3a5cfaa 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 ce69d9d7395..9085ba029b0 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 3852254a53b..a19405cdec9 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 d0d8e35fdd0..f50f1704875 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 431b3c27e42..417849ded55 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 5d8e93ef984..14f39dc67d7 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 5a1cc19c618..c34cfcac6ec 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 36b63be3453..12b80e09a55 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 285ac3f2202..2261658dd3f 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 0eb88b5c019..3434181107c 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 cc686be6d8a..568d73a4320 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 e9f9b70b916..fea4b3afc18 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 42b43982828..e39d8bf10e2 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 7cf163916bf..287f0af0823 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 25d0d48c8c3..25fd21e4d71 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 75b5cba9e81..7bb980d4596 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 29f656130f7..8467614fe5b 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 6115ae60eff..be3961bdff6 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 0980acccb88..d99fc41385d 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 220611517e0..2acd5e335db 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 99c34a587b9..135858fec77 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 4eb18c2de34..f6e4dec9538 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 7f33cfc64a8..db7b14f3daa 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 76fcffad459..3004d14adb3 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 d895872db4b..a91ed595bac 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 0dd003487c6..d6d62967cfb 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 f554955786a..e52eb4d1ce9 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 c0b659b41be..7b743b00b3d 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 d552692ae4f..6e5cf90babe 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 7cefcb96a3a..71893db5e5f 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 2cd4253cb8f..a8156e37f9b 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 767854b0fba..dafb7896181 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 b543484d892..49d24e863ca 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 8e6d1fb58d7..284fd9231d1 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 de6f10bf6cb..74582cffb71 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 660afecaaa9..0bc26954f0f 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 dc5696a9b79..95c9e24dcad 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 42b234827b1..37280207cb2 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 7902a35a9a6..1994947147c 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 a6000b1256f..2b76e273aa0 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 ca12fe876ca..72f52dda69a 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 675054317d9..391aa84bc17 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 7f44e356030..33a7c060ecc 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 610f4a9425f..5367167e285 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 a53b61a0072..06a37ea19a4 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 2b5ac81e30e..3b9ff8a0527 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 145a5df781b..3a3b0603ec8 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 deac7ef9d2a..bed6e5e96e6 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 6a65382baf4..66621463310 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 e8c283acc3b..ad1ca6ff2e0 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 f82791a5912..2e4e5fb3b81 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 cfae56fc2b6..7d35ddc68bf 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 beea119c79f..aea3f6e55d4 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 a982a26362f..c15c6068dc5 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 2d667d645cc..1b5398bb483 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 82c707869f8..e5b93449801 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 28509d42ee3..1053cd221eb 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 651cc00d2cd..8eb9dc2b6e1 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 e9604925e4a..dde615df094 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 ca4231a3561..9710a3e1aa0 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 fc99da714f6..baaa7168aa2 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 ddab5b8c522..ed9bb722a8a 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 7de8782ed44..ae5f9f94673 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 b4f4730d485..78436f644b4 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 f7291bfb603..847c836972f 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 dee1102e9d6..14f50e280e9 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 c69e0c98a40..2aba345ffc6 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 baf02fc4233..b075c65c821 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 ced6c706592..0752599e76b 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 9fd1dd2bf42..e56c3b3d79a 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 7bace66caba..3ef7ca22aca 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 a850e9602d0..698f8d772ad 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 b009152071e..74f251ec62b 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 7432101e787..c2378787e75 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 ac76884607f..37b9dcf5461 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 deb4990cf5d..333859f20d9 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 40697f0a6e3..58b227f4cb5 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 1815fe16fdb..c4f9147e33a 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 efa5da7da3b..a8d2cdc01c4 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 25b5fa6ffb7..d53e7109d6a 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 3f8703b657e..07be10deaa8 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 b710436a511..e86327f62f8 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