From 12c01f39aa1b68d0d0fc9ab251ac67d583593019 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 7 Apr 2021 11:56:08 +0000 Subject: [PATCH] fix autograd maybe has problem when using inplace operation --- deepspeech/modules/conformer_convolution.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepspeech/modules/conformer_convolution.py b/deepspeech/modules/conformer_convolution.py index b1caacef2..3ea44feef 100644 --- a/deepspeech/modules/conformer_convolution.py +++ b/deepspeech/modules/conformer_convolution.py @@ -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