未验证 提交 27159c42 编写于 作者: T Tian 提交者: GitHub

optimize memory allocation of optimizer (#53138)

上级 4e939c89
...@@ -774,7 +774,7 @@ class Optimizer: ...@@ -774,7 +774,7 @@ class Optimizer:
), "Optimizer set error, {} should in state dict".format( ), "Optimizer set error, {} should in state dict".format(
var_name var_name
) )
var.set_value(self._accumulators_holder[var_name]) var.set_value(self._accumulators_holder.pop(var_name))
self._accumulators[name][param.name] = var self._accumulators[name][param.name] = var
return var return var
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册