fix autograd maybe has problem when using inplace operation

pull/578/head
Hui Zhang 5 years ago
parent 220c9443a9
commit 12c01f39aa

@ -122,7 +122,7 @@ class ConvolutionModule(nn.Layer):
# mask batch padding # mask batch padding
if mask_pad is not None: 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 self.lorder > 0:
if cache is None: if cache is None:
@ -156,7 +156,7 @@ class ConvolutionModule(nn.Layer):
# mask batch padding # mask batch padding
if mask_pad is not None: 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] x = x.transpose([0, 2, 1]) # [B, T, C]
return x, new_cache return x, new_cache

Loading…
Cancel
Save