code: def get_correlations(
      Y: Union[torch.Tensor, ComplexTensor],
      inverse_power: torch.Tensor,
      taps,
      delay,
  ) -> Tuple[
      Union[torch.Tensor, ComplexTensor],
      Union[torch.Tensor, ComplexTensor],
  ]:
      """Calculates weighted correlations of a window of length taps
  
      Args:
          Y : Complex-valued STFT signal with shape (F, C, T)
          inverse_power : Weighting factor with shape (F, T)
          taps (int): Lenghts of correlation window
          delay (int): Delay for the weighting factor
  
      Returns:
          Correlation matrix of shape (F, taps*C, taps*C)
          Correlation vector of shape (F, taps, C, C)
      """
      assert inverse_power.dim() == 2, inverse_power.dim()
      assert inverse_power.size(0) == Y.size(0), (
          inverse_power.size(0),
          Y.size(0),
      )
  
      F, C, T = Y.size()
  
      # Y: (F, C, T) -> Psi: (F, C, T, taps)
      Psi = signal_framing(Y, frame_length=taps, frame_step=1)[
          ..., : T - delay - taps + 1, :
      ]
      # Reverse along taps-axis
      Psi = reverse(Psi, dim=-1)
      Psi_conj_norm = (
          Psi.conj()
          * inverse_power[..., None, delay + taps - 1 :, None]
      )
  
      # (F, C, T, taps) x (F, C, T, taps) -> (F, taps, C, taps, C)
      correlation_matrix = einsum(
          "fdtk,fetl->fkdle", Psi_conj_norm, Psi
      )
      # (F, taps, C, taps, C) -> (F, taps * C, taps * C)
      correlation_matrix = correlation_matrix.reshape(
          F, taps * C, taps * C
      )
  
      # (F, C, T, taps) x (F, C, T) -> (F, taps, C, C)
      correlation_vector = einsum(
          "fdtk,fet->fked", Psi_conj_norm, Y[..., delay + taps - 1 :]
      )
  
      return correlation_matrix, correlation_vector
  
file_path: espnet/espnet2/enh/layers/wpe.py
imports: from typing import Tuple, Union
  import torch
  import torch.nn.functional
  import torch_complex.functional
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complex_utils import einsum, matmul, reverse
label_desc: Use image node_id 3 for calling a global function with example usage: get_correlations(Y, inverse_power, taps, delay) and returns: correlation_matrix,  correlation_vector