Update egs/librispeech/ASR/pruned_transducer_stateless7_ctc_bs/frame_reducer.py

Co-authored-by: Fangjun Kuang <csukuangfj@gmail.com>
This commit is contained in:
Yifan Yang 2023-05-22 16:58:10 +08:00 committed by GitHub
parent e49fe2e7c4
commit 8f4bfc7efd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ class FrameReducer(nn.Module):
padding_mask = make_pad_mask(x_lens)
non_blank_mask = (ctc_output[:, :, blank_id] < math.log(0.9)) * (~padding_mask)
if y_lens is not None or self.training == False:
if y_lens is not None or self.training is False:
# Limit the maximum number of reduced frames
if y_lens is not None:
limit_lens = T - y_lens