diff --git a/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py b/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py index 320c14d4e9ca418f71a82beac3db60d30d55569b..fb69e29f340b77cbac24c1f6699c9e3c1436a264 100644 --- a/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py +++ b/python/paddle/fluid/contrib/slim/quantization/quantization_pass.py @@ -1148,7 +1148,7 @@ class QuantizationFreezePass(object): ], "the dim of scale_v should be 1 or 2" if scale_v.ndim == 2: scale_v = scale_v[0] - if scale_v.size == 1: + if scale_v.size == 1 and self._weight_quantize_type == 'abs_max': scale_v = scale_v[0] else: scale_v = scale_v.tolist()