code: def test_complex_norm(dim):
      mat = ComplexTensor(torch.rand(2, 3, 4), torch.rand(2, 3, 4))
      mat_th = torch.complex(mat.real, mat.imag)
      norm = complex_norm(mat, dim=dim, keepdim=True)
      norm_th = complex_norm(mat_th, dim=dim, keepdim=True)
      assert torch.allclose(norm, norm_th)
      if dim is not None:
          assert (
              norm.ndim == mat.ndim
              and mat.numel() == norm.numel() * mat.size(dim)
          )
  
file_path: espnet/test/espnet2/enh/layers/test_complex_utils.py
imports: import numpy
  import pytest
  import torch
  import torch_complex.functional
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complex_utils import cat, complex_norm, einsum, inverse, matmul, solve, stack, trace
label_desc: Use image node_id 2 for calling a global function with example usage: test_complex_norm(dim) without return types