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",")"]
docstr: Trim or pad the output to match the batch length.
  
  Args:
      input: tensor with shape (B, C, T)
      batch_length: int
  
  Returns:
      Tensor with shape (B, C, T), where T matches the
      batch length.
docstr_tok: ["Trim","or","pad","the","output","to","match","the","batch","length",".","Args",":","input",":","tensor","with","shape","(","B",",","C",",","T",")","batch_length",":","int","Returns",":","Tensor","with","shape","(","B",",","C",",","T",")",",","where","T","matches","the","batch","length","."]
code: def match_batch_length(self, input: torch.Tensor, batch_length: int):
      """Trim or pad the output to match the batch length.
  
      Args:
          input: tensor with shape (B, C, T)
          batch_length: int
  
      Returns:
          Tensor with shape (B, C, T), where T matches the
          batch length.
      """
      input_length = input.size(-1)
      pad_length = batch_length - input_length
      pad = (0, pad_length)
      # pad with zeros or crop
      return torch.nn.functional.pad(input, pad, "constant", 0)
  
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 10 for calling the EncMaskDecAudioToAudioModel obj's underlying member method code with example usage: obj.match_batch_length(input, batch_length) and returns: torch