From 25cabb76635d98a65ad1c4d7733052b5b00ad45e Mon Sep 17 00:00:00 2001 From: zzasdf <68544676+zzasdf@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:40:07 +0800 Subject: [PATCH] fix error in padding computing (#1607) --- egs/librispeech/SSL/zipformer/hubert_ce.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/SSL/zipformer/hubert_ce.py b/egs/librispeech/SSL/zipformer/hubert_ce.py index ba4e1cddd..1ac368a1d 100644 --- a/egs/librispeech/SSL/zipformer/hubert_ce.py +++ b/egs/librispeech/SSL/zipformer/hubert_ce.py @@ -429,7 +429,7 @@ class HubertModel(nn.Module): # padding_mask: (B, T), bool # mask_indices: (B, T), bool x = x.transpose(0, 1) - x, x_lens = self.encoder(x, ~padding_mask.sum(dim=-1)) + x, x_lens = self.encoder(x, (~padding_mask).sum(dim=-1)) x = x.transpose(0, 1) if features_only: