Skip to content

Commit d9ebbd3

Browse files
committed
Add torchscript test
1 parent 317835e commit d9ebbd3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/torchaudio_unittest/functional/torchscript_consistency_impl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,3 +547,14 @@ def func(tensor):
547547

548548
tensor = common_utils.get_whitenoise(sample_rate=44100)
549549
self._assert_consistency(func, tensor)
550+
551+
def test_compute_kaldi_pitch(self):
552+
if self.dtype != torch.float32 or self.device != torch.device('cpu'):
553+
raise unittest.SkipTest("Only float32, cpu is supported.")
554+
555+
def func(tensor):
556+
sample_rate: float = 44100.
557+
return F.compute_kaldi_pitch(tensor, sample_rate)
558+
559+
tensor = common_utils.get_whitenoise(sample_rate=44100)
560+
self._assert_consistency(func, tensor)

0 commit comments

Comments
 (0)