Skip to content

Commit

Permalink
Add torchscript test
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed Feb 8, 2021
1 parent 89e4efa commit 80f234d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,3 +547,14 @@ def func(tensor):

tensor = common_utils.get_whitenoise(sample_rate=44100)
self._assert_consistency(func, tensor)

def test_compute_kaldi_pitch(self):
if self.dtype != torch.float32 or self.device != torch.device('cpu'):
raise unittest.SkipTest("Only float32, cpu is supported.")

def func(tensor):
sample_rate: float = 44100.
return F.compute_kaldi_pitch(tensor, sample_rate)

tensor = common_utils.get_whitenoise(sample_rate=44100)
self._assert_consistency(func, tensor)

0 comments on commit 80f234d

Please sign in to comment.