From 74ee07d29adf7bc0128f59b3762b9d5f89a72494 Mon Sep 17 00:00:00 2001 From: harish Date: Tue, 26 Oct 2021 09:19:35 +0530 Subject: [PATCH] magphase deprecated --- docs/source/functional.rst | 6 ------ torchaudio/functional/__init__.py | 2 -- torchaudio/functional/functional.py | 26 -------------------------- 3 files changed, 34 deletions(-) diff --git a/docs/source/functional.rst b/docs/source/functional.rst index 60c548f5a9..b96fac11dc 100644 --- a/docs/source/functional.rst +++ b/docs/source/functional.rst @@ -81,12 +81,6 @@ complex_norm .. autofunction:: complex_norm - -magphase --------- - -.. autofunction:: magphase - :hidden:`Filtering` ~~~~~~~~~~~~~~~~~~~ diff --git a/torchaudio/functional/__init__.py b/torchaudio/functional/__init__.py index 5f81b7edf8..b741aaeb76 100644 --- a/torchaudio/functional/__init__.py +++ b/torchaudio/functional/__init__.py @@ -10,7 +10,6 @@ DB_to_amplitude, detect_pitch_frequency, griffinlim, - magphase, mask_along_axis, mask_along_axis_iid, mu_law_encoding, @@ -60,7 +59,6 @@ 'DB_to_amplitude', 'detect_pitch_frequency', 'griffinlim', - 'magphase', 'mask_along_axis', 'mask_along_axis_iid', 'mu_law_encoding', diff --git a/torchaudio/functional/functional.py b/torchaudio/functional/functional.py index 7982b0b6ce..cd8fc39ef5 100644 --- a/torchaudio/functional/functional.py +++ b/torchaudio/functional/functional.py @@ -28,7 +28,6 @@ "mu_law_decoding", "complex_norm", "angle", - "magphase", "phase_vocoder", 'mask_along_axis', 'mask_along_axis_iid', @@ -627,31 +626,6 @@ def angle( return torch.atan2(complex_tensor[..., 1], complex_tensor[..., 0]) -@_mod_utils.deprecated( - "Please convert the input Tensor to complex type with `torch.view_as_complex` then " - "use `torch.abs` and `torch.angle`. " - "Please refer to https://github.com/pytorch/audio/issues/1337 " - "for more details about torchaudio's plan to migrate to native complex type.", - version="0.11", -) -def magphase( - complex_tensor: Tensor, - power: float = 1.0 -) -> Tuple[Tensor, Tensor]: - r"""Separate a complex-valued spectrogram with shape `(..., 2)` into its magnitude and phase. - - Args: - complex_tensor (Tensor): Tensor shape of `(..., complex=2)` - power (float): Power of the norm. (Default: `1.0`) - - Returns: - (Tensor, Tensor): The magnitude and phase of the complex tensor - """ - mag = complex_norm(complex_tensor, power) - phase = angle(complex_tensor) - return mag, phase - - def phase_vocoder( complex_specgrams: Tensor, rate: float,