mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
remove if-branch at downsampling pad
This commit is contained in:
parent
f59e06c556
commit
8f8b09498f
@ -1229,7 +1229,6 @@ class SimpleDownsample(torch.nn.Module):
|
||||
d_seq_len = (seq_len + ds - 1) // ds
|
||||
|
||||
# Pad to an exact multiple of self.downsample
|
||||
if seq_len != d_seq_len * ds:
|
||||
# right-pad src, repeating the last element.
|
||||
pad = d_seq_len * ds - seq_len
|
||||
src_extra = src[src.shape[0]-1:].expand(pad, src.shape[1], src.shape[2])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user