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

optimize memory allocation of optimizer (#53097)

上级 b2d5cfab
...@@ -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.
先完成此消息的编辑!
想要评论请 注册