class_docstr: Computes signal-to-distortion ratio (SDR) loss with weighted average across channels.
  
  Args:
      weight: weight for SDR of each output channel, used for averaging the loss across channels. Defaults to `None` (averaging).
      reduction: batch reduction. Defaults to `mean` over the batch.
      scale_invariant: If `True`, use scale-invariant SDR. Defaults to `False`.
      remove_mean: Remove mean before calculating the loss. Defaults to `True`.
      sdr_max: Soft thresholding of the loss to SDR_max.
      eps: Small value for regularization.
class_docstr_tok: ["Computes","signal-to-distortion","ratio","(","SDR",")","loss","with","weighted","average","across","channels",".","Args",":","weight",":","weight","for","SDR","of","each","output","channel",",","used","for","averaging","the","loss","across","channels",".","Defaults","to","`","None","`","(","averaging",")",".","reduction",":","batch","reduction",".","Defaults","to","`","mean","`","over","the","batch",".","scale_invariant",":","If","`","True","`",",","use","scale-invariant","SDR",".","Defaults","to","`","False","`",".","remove_mean",":","Remove","mean","before","calculating","the","loss",".","Defaults","to","`","True","`",".","sdr_max",":","Soft","thresholding","of","the","loss","to","SDR_max",".","eps",":","Small","value","for","regularization","."]
docstr: For input batch of multi-channel signals, calculate SDR between estimate and target for each channel,
  perform averaging across channels (weighting optional), and apply reduction across the batch.
  
  Args:
      estimate: Batch of signals, shape (B, T, C)
      target: Batch of signals, shape (B, T, C)
      input_length: Batch of lengths, shape (B,)
      mask: Batch of temporal masks, shape (B, T)
  
  Returns:
      Scalar loss.
docstr_tok: ["For","input","batch","of","multi-channel","signals",",","calculate","SDR","between","estimate","and","target","for","each","channel",",","perform","averaging","across","channels","(","weighting","optional",")",",","and","apply","reduction","across","the","batch",".","Args",":","estimate",":","Batch","of","signals",",","shape","(","B",",","T",",","C",")","target",":","Batch","of","signals",",","shape","(","B",",","T",",","C",")","input_length",":","Batch","of","lengths",",","shape","(","B",",",")","mask",":","Batch","of","temporal","masks",",","shape","(","B",",","T",")","Returns",":","Scalar","loss","."]
code: def forward(
      self,
      estimate: torch.Tensor,
      target: torch.Tensor,
      input_length: Optional[torch.Tensor] = None,
      mask: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      """For input batch of multi-channel signals, calculate SDR between estimate and target for each channel,
      perform averaging across channels (weighting optional), and apply reduction across the batch.
  
      Args:
          estimate: Batch of signals, shape (B, T, C)
          target: Batch of signals, shape (B, T, C)
          input_length: Batch of lengths, shape (B,)
          mask: Batch of temporal masks, shape (B, T)
  
      Returns:
          Scalar loss.
      """
  
      sdr = calculate_sdr_batch(
          estimate=estimate,
          target=target,
          input_length=input_length,
          mask=mask,
          scale_invariant=self.scale_invariant,
          convolution_invariant=self.convolution_invariant,
          convolution_filter_length=self.convolution_filter_length,
          remove_mean=self.remove_mean,
          sdr_max=self.sdr_max,
          eps=self.eps,
      )
  
      # channel averaging
      if self.weight is None:
          sdr = torch.mean(sdr, dim=1)
      else:
          # weighting across channels
          sdr = sdr * self.weight
          sdr = torch.sum(sdr, dim=1)
  
      # reduction
      sdr = self.reduce(sdr)
  
      return -sdr
  
file_path: NeMo/nemo/collections/asr/losses/audio_losses.py
imports: import math
  from typing import List, Optional
  import numpy
  import torch
  from nemo.collections.asr.parts.preprocessing.features import make_seq_mask_like
  from nemo.collections.asr.parts.utils.audio_utils import toeplitz
  from nemo.core.classes import Loss, Typing, typecheck
  from nemo.core.neural_types import AudioSignal, LengthsType, LossType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the SDRLoss obj's underlying member method code with example usage: obj.forward(estimate, target, input_length, mask) and returns: unknown