diff --git a/paddle/fluid/inference/tensorrt/op_teller.cc b/paddle/fluid/inference/tensorrt/op_teller.cc index b12b3a2c8a41bfa965e47d2c7249fb6a794b8f8a..2462ad7d9259d09104e9dfdce417f26a00e5e08a 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -54,7 +54,10 @@ struct SimpleOpTypeSetTeller : public Teller { "leaky_relu", "fc", "relu6", - "concat"}; + "concat", + "scale", + "elementwise_mul", + "conv2d_transpose"}; std::unordered_set teller_set{ "mul", "conv2d", diff --git a/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py b/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py index c1aaa896e9cb994c883a7c411f38e8b092018507..d4b9f9d8f3d682ec31d38cf6736a81eea4f19ddc 100644 --- a/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py +++ b/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py @@ -46,9 +46,26 @@ _fake_quant_dequant_op_list = [ ] _out_scale_op_list = [ - "conv2d", "depthwise_conv2d", "mul", "matmul", "relu", "leaky_relu", - "relu6", "sigmoid", "tanh", "prelu", "swish", "softmax", "batch_norm", - "elementwise_add", "pool2d", "reshape2", "transpose2", "concat" + "conv2d", + "depthwise_conv2d", + "mul", + "matmul", + "relu", + "leaky_relu", + "relu6", + "sigmoid", + "tanh", + "prelu", + "swish", + "softmax", + "batch_norm", + "elementwise_add", + "pool2d", + "reshape2", + "transpose2", + "concat", + "elementwise_mul", + "scale", ] # list op real input and output names, to avoid processing input such as AxisTensor. @@ -89,6 +106,8 @@ _op_real_in_out_name = { "dropout": [["X"], ["Out"]], "batch_norm": [["X"], ["Y"]], "sigmoid": [["X"], ["Out"]], + "elementwise_mul": [["X", "Y"], ["Out"]], + "scale": [["X"], ["Out"]], }