From e062c71076429de3d80008222863cce5349c376b Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 16 May 2023 17:34:21 +0800 Subject: [PATCH] Efficiency, small fix --- egs/libriheavy/LM/zipformer1/subformer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/egs/libriheavy/LM/zipformer1/subformer.py b/egs/libriheavy/LM/zipformer1/subformer.py index e1aca3fdb..15717a2b9 100644 --- a/egs/libriheavy/LM/zipformer1/subformer.py +++ b/egs/libriheavy/LM/zipformer1/subformer.py @@ -686,6 +686,8 @@ class SubformerEncoder(nn.Module): changing the batch size. """ (seq_len, batch_size, num_channels) = src.shape + if chunk_size == seq_len: + return src src = src.transpose(0, 1).contiguous().reshape(-1, chunk_size, num_channels) return src.transpose(0, 1).contiguous()