未验证 提交 edd5e9a8 编写于 作者: Y Yuang Liu 提交者: GitHub

fix bug for fused_linear_grad_add and main_grad (#56030)

上级 42e0c6b8
......@@ -55,6 +55,8 @@ class MixPrecisionLayer(nn.Layer):
), "In main_grad node, param.grad should be None, but find param[{}] has grad.".format(
param.name
)
if tmp_grad._is_initialized():
# Some previous pylayer may return None, should check grad validation.
if param.main_grad is None:
param.main_grad = core.eager.Tensor(
value=tmp_grad.cast(paddle.float32).value(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册