diff --git a/test/torchaudio_unittest/functional/torchscript_consistency_impl.py b/test/torchaudio_unittest/functional/torchscript_consistency_impl.py index d7bc3a1c70..b6aec04d9c 100644 --- a/test/torchaudio_unittest/functional/torchscript_consistency_impl.py +++ b/test/torchaudio_unittest/functional/torchscript_consistency_impl.py @@ -547,6 +547,21 @@ def func(tensor): 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'):