Skip to content

Commit

Permalink
Quick wav2vec fix. In-place operation adding convolutional positions …
Browse files Browse the repository at this point in the history
…to encoder was overwriting leaf history. Wasn't caught on previous torch versions. (NVIDIA#4383)

Signed-off-by: tbartley94 <tbartley@nvidia.com>

Co-authored-by: tbartley94 <tbartley@nvidia.com>
  • Loading branch information
bonham79 and tbartley94 committed Jun 16, 2022
1 parent 17528bb commit 0322b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nemo/collections/asr/modules/wav2vec_modules.py
Expand Up @@ -313,7 +313,7 @@ def forward(self, audio_signal, length):
audio_signal[idx, :, len:] = 0.0

signal_conv = self.pos_conv(audio_signal) # B, C, T
audio_signal += signal_conv
audio_signal = audio_signal + signal_conv

audio_signal = audio_signal.transpose(1, 2) # B, C, T -> B, T, C
audio_signal = self.layer_norm(audio_signal)
Expand Down

0 comments on commit 0322b15

Please sign in to comment.