From 1e557e94d733f1df648371747f9ee8012dc75346 Mon Sep 17 00:00:00 2001 From: John Muradeli Date: Sat, 30 Aug 2025 11:49:50 +0000 Subject: [PATCH] Fix ``hop_length`` default in ``_stretch_waveform`` --- src/torchaudio/functional/functional.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torchaudio/functional/functional.py b/src/torchaudio/functional/functional.py index 5d4284d595..96cf2eca86 100644 --- a/src/torchaudio/functional/functional.py +++ b/src/torchaudio/functional/functional.py @@ -1706,10 +1706,10 @@ def _stretch_waveform( Returns: Tensor: The preprocessed waveform stretched prior to resampling. """ - if hop_length is None: - hop_length = n_fft // 4 if win_length is None: win_length = n_fft + if hop_length is None: + hop_length = win_length // 4 if window is None: window = torch.hann_window(window_length=win_length, device=waveform.device)