KEMBAR78
Remove `F.complex_norm` and `T.ComplexNorm` · Issue #1884 · pytorch/audio · GitHub
Skip to content

Remove F.complex_norm and T.ComplexNorm #1884

@mthrok

Description

@mthrok

As planned in #1337, F.complex_norm and T.ComplexNorm are now deprecated, and we can remove them.

Steps

  1. Remove the implementation

def complex_norm(

class ComplexNorm(torch.nn.Module):

  1. Remove test

@parameterized.expand(
list(itertools.product([(1, 2, 1025, 400, 2), (1025, 400, 2)], [1, 2, 0.7]))
)
def test_complex_norm(self, shape, power):
torch.random.manual_seed(42)
complex_tensor = torch.randn(*shape, dtype=self.dtype, device=self.device)
expected_norm_tensor = complex_tensor.pow(2).sum(-1).pow(power / 2)
norm_tensor = F.complex_norm(complex_tensor, power)
self.assertEqual(norm_tensor, expected_norm_tensor, atol=1e-5, rtol=1e-5)

  1. Make sure the test passes.

  2. Update docs

https://github.com/pytorch/audio/blob/25a8adf6d642bc27b156a452bc80f20741382642/docs/source/functional.rst

https://github.com/pytorch/audio/blob/25a8adf6d642bc27b156a452bc80f20741382642/docs/source/transforms.rst

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