class_docstr: Class for encoder-mask-decoder audio processing models.
  
  The model consists of the following blocks:
      - encoder: transforms input multi-channel audio signal into an encoded representation (analysis transform)
      - mask_estimator: estimates a mask used by signal processor
      - mask_processor: mask-based signal processor, combines the encoded input and the estimated mask
      - decoder: transforms processor output into the time domain (synthesis transform)
class_docstr_tok: ["Class","for","encoder-mask-decoder","audio","processing","models",".","The","model","consists","of","the","following","blocks",":","-","encoder",":","transforms","input","multi-channel","audio","signal","into","an","encoded","representation","(","analysis","transform",")","-","mask_estimator",":","estimates","a","mask","used","by","signal","processor","-","mask_processor",":","mask-based","signal","processor",",","combines","the","encoded","input","and","the","estimated","mask","-","decoder",":","transforms","processor","output","into","the","time","domain","(","synthesis","transform",")"]
code: def training_step(self, batch, batch_idx):
      input_signal, input_length, target_signal, target_length = batch
  
      # Expand channel dimension, if necessary
      # For consistency, the model uses multi-channel format, even if the channel dimension is 1
      if input_signal.ndim == 2:
          input_signal = input_signal.unsqueeze(1)
      if target_signal.ndim == 2:
          target_signal = target_signal.unsqueeze(1)
  
      # Apply channel augmentation
      if self.training and self.channel_augmentation is not None:
          input_signal = self.channel_augmentation(input=input_signal)
  
      # Process input
      processed_signal, _ = self.forward(
          input_signal=input_signal, input_length=input_length
      )
  
      # Calculate the loss
      loss = self.loss(
          estimate=processed_signal,
          target=target_signal,
          input_length=input_length,
      )
  
      # Logs
      self.log("train_loss", loss)
      self.log("learning_rate", self._optimizer.param_groups[0]["lr"])
      self.log(
          "global_step",
          torch.tensor(self.trainer.global_step, dtype=torch.float32),
      )
  
      # Return loss
      return loss
  
imports: import json
  import os
  import tempfile
  from typing import Dict, List, Optional, Union
  import librosa
  import soundfile
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from tqdm import tqdm
  from nemo.collections.asr.data import audio_to_audio_dataset
  from nemo.collections.asr.data.audio_to_text_dataset import inject_dataloader_value_from_model_config
  from nemo.collections.asr.models.audio_to_audio_model import AudioToAudioModel
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import AudioSignal, LengthsType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 12 for calling the EncMaskDecAudioToAudioModel obj's underlying member method code with example usage: obj.training_step(batch, batch_idx) and returns: loss