Skip to content

Commit

Permalink
throw error for resampling int waveform
Browse files Browse the repository at this point in the history
  • Loading branch information
Caroline Chen committed Apr 4, 2022
1 parent 4a749e2 commit 44e925d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchaudio/functional/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,11 @@ def _apply_sinc_resample_kernel(
kernel: Tensor,
width: int,
):
if not waveform.is_floating_point():
raise TypeError(
f"Expected floating point type for waveform tensor, but received {waveform.dtype}."
)

orig_freq = int(orig_freq) // gcd
new_freq = int(new_freq) // gcd

Expand Down

0 comments on commit 44e925d

Please sign in to comment.