Fix w.r.t. uneven upsampling

This commit is contained in:
Daniel Povey 2022-09-28 13:57:26 +08:00
parent 10a3061025
commit 1005ff35ba

View File

@ -456,6 +456,8 @@ class DownsampledConformerEncoder(nn.Module):
src, src_key_padding_mask=mask, warmup=warmup
)
src = self.upsample(src)
# remove any extra frames that are not a multiple of downsample_factor
src = src[:src_orig.shape[0]]
return src