diff --git a/paddleslim/analysis/flops.py b/paddleslim/analysis/flops.py index 7b8570e84575de7254b2d66868264579abd2dc8c..04756313f3ca53c7f4651b46c276b2f9e65ba7ab 100644 --- a/paddleslim/analysis/flops.py +++ b/paddleslim/analysis/flops.py @@ -86,7 +86,7 @@ def _graph_flops(graph, only_conv=True, detail=False): k_size = op.attr("ksize") flops += h_out * w_out * c_out * (k_size[0]**2) - elif op.type() == 'mul': + elif op.type() in ['mul', 'matmul', 'matmul_v2']: x_shape = list(op.inputs("X")[0].shape()) y_shape = op.inputs("Y")[0].shape() if x_shape[0] == -1: