mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Efficiency, small fix
This commit is contained in:
parent
cf93d1f129
commit
e062c71076
@ -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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user