code: def get_power_spectral_density_matrix(
      xs, mask, normalization=True, reduction="mean", eps: float = 1e-15
  ):
      """Return cross-channel power spectral density (PSD) matrix
  
      Args:
          xs (torch.complex64/ComplexTensor): (..., F, C, T)
          reduction (str): "mean" or "median"
          mask (torch.Tensor): (..., F, C, T)
          normalization (bool):
          eps (float):
      Returns
          psd (torch.complex64/ComplexTensor): (..., F, C, C)
  
      """
      if reduction == "mean":
          # Averaging mask along C: (..., C, T) -> (..., 1, T)
          mask = mask.mean(dim=-2, keepdim=True)
      elif reduction == "median":
          mask = mask.median(dim=-2, keepdim=True)
      else:
          raise ValueError("Unknown reduction mode: %s" % reduction)
  
      # Normalized mask along T: (..., T)
      if normalization:
          # If assuming the tensor is padded with zero, the summation along
          # the time axis is same regardless of the padding length.
          mask = mask / (mask.sum(dim=-1, keepdim=True) + eps)
  
      # outer product: (..., C_1, T) x (..., C_2, T) -> (..., C, C_2)
      psd = einsum("...ct,...et->...ce", xs * mask, xs.conj())
  
      return psd
  
imports: from typing import List, Union
  import torch
  from packaging.version import parse
  from torch_complex import functional
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complex_utils import cat, complex_norm, einsum, inverse, is_complex, is_torch_complex_tensor, matmul, reverse, solve, to_double
label_desc: Use image node_id 2 for calling a global function with example usage: get_power_spectral_density_matrix(xs, mask, normalization, reduction, eps) and returns: psd