Unverified Commit 0b1d1f06 authored by pw2406's avatar pw2406 Committed by GitHub
Browse files

Add TorchScript test for `F.phase_vocoder` (#1379)

parent ea857940
......@@ -547,6 +547,21 @@ class Functional(common_utils.TestBaseMixin):
tensor = common_utils.get_whitenoise(sample_rate=44100)
self._assert_consistency(func, tensor)
def test_phase_vocoder(self):
def func(tensor, device: torch.device = self.device):
rate = 0.5
hop_length = 256
phase_advance = torch.linspace(
0,
3.14 * hop_length,
tensor.shape[-3],
dtype=torch.float64,
).to(device)[..., None]
return F.phase_vocoder(tensor, rate, phase_advance)
tensor = torch.randn(2, 1025, 400, 2)
self._assert_consistency(func, tensor)
@common_utils.skipIfNoKaldi
def test_compute_kaldi_pitch(self):
if self.dtype != torch.float32 or self.device != torch.device('cpu'):
......
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