Skip to content

Remove deprecated F.angle #1831

@mthrok

Description

@mthrok

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

  1. Remove the implementation


@_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])

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions