From de9a6ebd6ccc9bb1e12b6fa3850dc073c89c616f Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Fri, 28 Oct 2022 19:26:06 +0800 Subject: [PATCH] Fix bug RE seq lengths --- egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py index cfc15ab94..baa096334 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py @@ -228,7 +228,8 @@ class Zipformer(EncoderInterface): x = self.downsample_output(x) # class Downsample has this rounding behavior.. - lengths = (x_lens + 1) // 2 + assert self.output_downsampling_factor == 2 + lengths = (lengths + 1) // 2 x = x.permute(1, 0, 2) # (T, N, C) ->(N, T, C)