Skip to content

Commit 7ee1d38

Browse files
committed
try a fix on stretch fail
1 parent bb37eca commit 7ee1d38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchaudio/functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def stretch(tensor, factor, interpolate, ch_dim):
423423

424424
# Select interpolation type
425425
if interpolate.lower() == 'linear':
426-
ref1 = ref.int().float()
426+
ref1 = ref.floor().float()
427427
ref2 = torch.clamp_max(ref1 + 1, tensor.size(1) - 1)
428428
r = (ref - ref1).type(type_orig) # Ratio of sound[ref] to use
429429
stretched_sound = (tensor[:, ref1.long()] * (1 - r) +

0 commit comments

Comments
 (0)