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 __init__(self, cfg: DictConfig, trainer: Trainer = None):
      # Get global rank and total number of GPU workers for IterableDataset partitioning, if applicable
      # Global_rank and local_rank is set by LightningModule in Lightning 1.2.0
      self.world_size = 1
      if trainer is not None:
          self.world_size = trainer.world_size
  
      super().__init__(cfg=cfg, trainer=trainer)
      self.sample_rate = self._cfg.sample_rate
  
      # Setup processing modules
      self.encoder = EncMaskDecAudioToAudioModel.from_config_dict(
          self._cfg.encoder
      )
      self.mask_estimator = (
          EncMaskDecAudioToAudioModel.from_config_dict(
              self._cfg.mask_estimator
          )
      )
      self.mask_processor = (
          EncMaskDecAudioToAudioModel.from_config_dict(
              self._cfg.mask_processor
          )
      )
      self.decoder = EncMaskDecAudioToAudioModel.from_config_dict(
          self._cfg.decoder
      )
  
      if "mixture_consistency" in self._cfg:
          logging.debug("Using mixture consistency")
          self.mixture_consistency = (
              EncMaskDecAudioToAudioModel.from_config_dict(
                  self._cfg.mixture_consistency
              )
          )
      else:
          logging.debug("Mixture consistency not used")
          self.mixture_consistency = None
  
      # Future enhancement:
      # If subclasses need to modify the config before calling super()
      # Check ASRBPE* classes do with their mixin
  
      # Setup augmentation
      if (
          hasattr(self.cfg, "channel_augment")
          and self.cfg.channel_augment is not None
      ):
          logging.debug("Using channel augmentation")
          self.channel_augmentation = (
              EncMaskDecAudioToAudioModel.from_config_dict(
                  self.cfg.channel_augment
              )
          )
      else:
          logging.debug("Channel augmentation not used")
          self.channel_augmentation = None
  
      # Setup optional Optimization flags
      self.setup_optimization_flags()
  
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 1 to create a new EncMaskDecAudioToAudioModel object from inherited base classes: AudioToAudioModel with example: obj = EncMaskDecAudioToAudioModel(cfg, trainer)