Commit c18a103b authored by Sean Kim's avatar Sean Kim Committed by Facebook GitHub Bot
Browse files

fix resample (#2561)

Summary:
Added back device in case of tensor creation

Pull Request resolved: https://github.com/pytorch/audio/pull/2561

Reviewed By: mthrok

Differential Revision: D38035351

Pulled By: skim0514

fbshipit-source-id: bdea07cbb34d0aa487187cded1a5636da6623d96
parent 4778c2e5
...@@ -1447,7 +1447,7 @@ def _get_sinc_resample_kernel( ...@@ -1447,7 +1447,7 @@ def _get_sinc_resample_kernel(
idx = torch.arange(-width, width + orig_freq, dtype=idx_dtype, device=device)[None, None] / orig_freq idx = torch.arange(-width, width + orig_freq, dtype=idx_dtype, device=device)[None, None] / orig_freq
t = torch.arange(0, -new_freq, -1, dtype=dtype)[:, None, None] / new_freq + idx t = torch.arange(0, -new_freq, -1, dtype=dtype, device=device)[:, None, None] / new_freq + idx
t *= base_freq t *= base_freq
t = t.clamp_(-lowpass_filter_width, lowpass_filter_width) t = t.clamp_(-lowpass_filter_width, lowpass_filter_width)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment