提交 12c01f39 编写于 作者: H Hui Zhang

fix autograd maybe has problem when using inplace operation

上级 220c9443
......@@ -122,7 +122,7 @@ class ConvolutionModule(nn.Layer):
# mask batch padding
if mask_pad is not None:
x.masked_fill_(mask_pad, 0.0)
x = x.masked_fill(mask_pad, 0.0)
if self.lorder > 0:
if cache is None:
......@@ -156,7 +156,7 @@ class ConvolutionModule(nn.Layer):
# mask batch padding
if mask_pad is not None:
x.masked_fill_(mask_pad, 0.0)
x = x.masked_fill(mask_pad, 0.0)
x = x.transpose([0, 2, 1]) # [B, T, C]
return x, new_cache
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册