未验证 提交 dfdcfb94 编写于 作者: Z zhangbo9674 提交者: GitHub

amp.decorate save_dtype hook skil int (#43824)

上级 576236a0
......@@ -395,9 +395,10 @@ class StateDictHook(object):
for key in state_dict:
param = state_dict[key]
with paddle.fluid.dygraph.guard():
param_applied = paddle.cast(param, self._save_dtype)
param_applied.name = param.name
state_dict[key] = param_applied
if paddle.is_floating_point(param):
param_applied = paddle.cast(param, self._save_dtype)
param_applied.name = param.name
state_dict[key] = param_applied
@dygraph_only
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册