未验证 提交 c838c1ed 编写于 作者: C ceci3 提交者: GitHub

clear tmp var in ptq (#48660)

上级 e1e8bf72
...@@ -692,11 +692,10 @@ class PostTrainingQuantization: ...@@ -692,11 +692,10 @@ class PostTrainingQuantization:
''' '''
Reset activations to be not persistable. Reset activations to be not persistable.
''' '''
to_erase = []
for var in self._program.list_vars(): for var in self._program.list_vars():
if var.name in self._quantized_act_var_name: if var.name in self._quantized_act_var_name:
var.persistable = False var.persistable = False
to_erase.append(var.name) self._scope.find_var(var.name).get_tensor()._clear()
def _sampling(self): def _sampling(self):
''' '''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册