class_docstr: Parametric multichannel Wiener filter, with an adjustable
  tradeoff between noise reduction and speech distortion.
  It supports automatic reference channel selection based
  on the estimated output SNR.
  
  Args:
      beta: Parameter of the parameteric filter, tradeoff between noise reduction
            and speech distortion (0: MVDR, 1: MWF).
      rank: Rank assumption for the speech covariance matrix.
      postfilter: Optional postfilter. If None, no postfilter is applied.
      ref_channel: Optional, reference channel. If None, it will be estimated automatically.
      ref_hard: If true, estimate a hard (one-hot) reference. If false, a soft reference.
      ref_hard_use_grad: If true, use straight-through gradient when using the hard reference
      ref_subband_weighting: If true, use subband weighting when estimating reference channel
      num_subbands: Optional, used to determine the parameter size for reference estimation
      diag_reg: Optional, diagonal regularization for the multichannel filter
      eps: Small regularization constant to avoid division by zero
  
  References:
      - Souden et al, On Optimal Frequency-Domain Multichannel Linear Filtering for Noise Reduction, 2010
code: def __init__(
      self,
      beta: float = 1.0,
      rank: str = "one",
      postfilter: Optional[str] = None,
      ref_channel: Optional[int] = None,
      ref_hard: bool = True,
      ref_hard_use_grad: bool = True,
      ref_subband_weighting: bool = False,
      num_subbands: Optional[int] = None,
      diag_reg: Optional[float] = 1e-6,
      eps: float = 1e-8,
  ):
      if not HAVE_TORCHAUDIO:
          logging.error(
              "Could not import torchaudio. Some features might not work."
          )
  
          raise ModuleNotFoundError(
              f"torchaudio is not installed but is necessary to instantiate a {self.__class__.__name__}"
          )
  
      super().__init__()
  
      # Parametric filter
      # 0=MVDR, 1=MWF
      self.beta = beta
  
      # Rank
      # Assumed rank for the signal covariance matrix (psd_s)
      self.rank = rank
  
      if self.rank == "full" and self.beta == 0:
          raise ValueError(
              f"Rank {self.rank} is not compatible with beta {self.beta}."
          )
  
      # Postfilter, applied on the output of the multichannel filter
      if postfilter not in [None, "ban"]:
          raise ValueError(f"Postfilter {postfilter} is not supported.")
      self.postfilter = postfilter
  
      # Regularization
      if diag_reg is not None and diag_reg < 0:
          raise ValueError(
              f"Diagonal regularization {diag_reg} must be positive."
          )
      self.diag_reg = diag_reg
  
      if eps <= 0:
          raise ValueError(f"Epsilon {eps} must be positive.")
      self.eps = eps
  
      # PSD estimator
      self.psd = torchaudio.transforms.PSD()
  
      # Reference channel
      self.ref_channel = ref_channel
      if self.ref_channel == "max_snr":
          self.ref_estimator = ReferenceChannelEstimatorSNR(
              hard=ref_hard,
              hard_use_grad=ref_hard_use_grad,
              subband_weighting=ref_subband_weighting,
              num_subbands=num_subbands,
              eps=eps,
          )
      else:
          self.ref_estimator = None
      # Flag to determine if the filter is MISO or MIMO
      self.is_mimo = self.ref_channel is None
  
      logging.debug("Initialized %s", self.__class__.__name__)
      logging.debug("\tbeta:        %f", self.beta)
      logging.debug("\trank:        %s", self.rank)
      logging.debug("\tpostfilter:  %s", self.postfilter)
      logging.debug("\tdiag_reg:    %g", self.diag_reg)
      logging.debug("\teps:         %g", self.eps)
      logging.debug("\tref_channel: %s", self.ref_channel)
      logging.debug("\tis_mimo:     %s", self.is_mimo)
  
imports: import random
  from typing import Callable, Optional
  import torch
  from nemo.collections.asr.parts.submodules.multi_head_attention import MultiHeadAttention
  from nemo.core.classes import NeuralModule, typecheck
  from nemo.core.neural_types import AudioSignal, FloatType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new ParametricMultichannelWienerFilter object from inherited base classes: NeuralModule with example: obj = ParametricMultichannelWienerFilter(beta, rank, postfilter, ref_channel, ref_hard, ref_hard_use_grad, ref_subband_weighting, num_subbands, diag_reg, eps)