-
Notifications
You must be signed in to change notification settings - Fork 732
Closed
Milestone
Description
As the main branch is now bumped to 0.11, we would like to remove some deprecated functions.
The target is torchaudio.functional.angle.
The detailed context can be found #1337
Steps
- Remove the implementation
audio/torchaudio/functional/functional.py
Line 32 in 60aeb78
| "angle", |
audio/torchaudio/functional/functional.py
Lines 738 to 756 in 60aeb78
| @_mod_utils.deprecated( | |
| "Please convert the input Tensor to complex type with `torch.view_as_complex` then " | |
| "use `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 angle( | |
| complex_tensor: Tensor | |
| ) -> Tensor: | |
| r"""Compute the angle of complex tensor input. | |
| Args: | |
| complex_tensor (Tensor): Tensor shape of `(..., complex=2)` | |
| Return: | |
| Tensor: Angle of a complex tensor. Shape of `(..., )` | |
| """ | |
| return torch.atan2(complex_tensor[..., 1], complex_tensor[..., 0]) |
audio/torchaudio/functional/__init__.py
Line 57 in 60aeb78
| 'angle', |
- Make sure the test passes.
Surprisingly, there seems to be no test for angle function, so it should be fine, but you can either run tests in local or make a PR and CI will kick off the tests.
Note
For setting up the development environment, please refer to CONTRIBUTING.md and torchaudio_unittest