diff --git a/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py b/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py index 68df2a8adcc961c2b34a6cbc92d803fa1bb211c2..fa57a9bd746eadc7b867bb699b05efee065b53f0 100644 --- a/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py +++ b/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py @@ -692,11 +692,10 @@ class PostTrainingQuantization: ''' Reset activations to be not persistable. ''' - to_erase = [] for var in self._program.list_vars(): if var.name in self._quantized_act_var_name: var.persistable = False - to_erase.append(var.name) + self._scope.find_var(var.name).get_tensor()._clear() def _sampling(self): '''