Skip to content

Commit

Permalink
kernel device
Browse files Browse the repository at this point in the history
  • Loading branch information
Caroline Chen committed May 14, 2021
1 parent 7a482fb commit 566c0db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchaudio/functional/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,6 @@ def _apply_sinc_resample_kernel(
# pack batch
shape = waveform.size()
waveform = waveform.view(-1, shape[-1])
kernel = kernel.to(device=waveform.device, dtype=waveform.dtype)

num_wavs, length = waveform.shape
waveform = torch.nn.functional.pad(waveform, (width, width + orig_freq))
Expand Down Expand Up @@ -1434,5 +1433,6 @@ def resample(
gcd = math.gcd(int(orig_freq), int(new_freq))

kernel, width = _get_sinc_resample_kernel(orig_freq, new_freq, gcd, lowpass_filter_width, rolloff)
kernel = kernel.to(device=waveform.device, dtype=waveform.dtype)
resampled = _apply_sinc_resample_kernel(waveform, orig_freq, new_freq, gcd, kernel, width)
return resampled

0 comments on commit 566c0db

Please sign in to comment.