class_docstr: Encoder decoder class for speaker label models.
  Model class creates training, validation methods for setting up data
  performing model forward pass.
  Expects config dict for
      * preprocessor
      * Jasper/Quartznet Encoder
      * Speaker Decoder
class_docstr_tok: ["Encoder","decoder","class","for","speaker","label","models",".","Model","class","creates","training",",","validation","methods","for","setting","up","data","performing","model","forward","pass",".","Expects","config","dict","for","*","preprocessor","*","Jasper\/Quartznet","Encoder","*","Speaker","Decoder"]
code: def __setup_dataloader_from_config(self, config: Optional[Dict]):
      if "augmentor" in config:
          augmentor = process_augmentations(config["augmentor"])
      else:
          augmentor = None
  
      featurizer = WaveformFeaturizer(
          sample_rate=config["sample_rate"],
          int_values=config.get("int_values", False),
          augmentor=augmentor,
      )
      shuffle = config.get("shuffle", False)
      if config.get("is_tarred", False):
          if (
              "tarred_audio_filepaths" in config
              and config["tarred_audio_filepaths"] is None
          ) or (
              "manifest_filepath" in config
              and config["manifest_filepath"] is None
          ):
              logging.warning(
                  "Could not load dataset as `manifest_filepath` was None or "
                  f"`tarred_audio_filepaths` is None. Provided config : {config}"
              )
              return None
  
          shuffle_n = (
              config.get("shuffle_n", 4 * config["batch_size"])
              if shuffle
              else 0
          )
          if config.get("is_concat", False):
              dataset = get_concat_tarred_speech_label_dataset(
                  featurizer=featurizer,
                  config=config,
                  shuffle_n=shuffle_n,
                  global_rank=self.global_rank,
                  world_size=self.world_size,
              )
          else:
              dataset = get_tarred_speech_label_dataset(
                  featurizer=featurizer,
                  config=config,
                  shuffle_n=shuffle_n,
                  global_rank=self.global_rank,
                  world_size=self.world_size,
              )
          shuffle = False
      else:
          if (
              "manifest_filepath" in config
              and config["manifest_filepath"] is None
          ):
              logging.warning(
                  f"Could not load dataset as `manifest_filepath` was None. Provided config : {config}"
              )
              return None
  
          dataset = AudioToSpeechLabelDataset(
              manifest_filepath=config["manifest_filepath"],
              labels=config["labels"],
              featurizer=featurizer,
              max_duration=config.get("max_duration", None),
              min_duration=config.get("min_duration", None),
              trim=config.get("trim_silence", False),
              normalize_audio=config.get("normalize_audio", False),
              cal_labels_occurrence=config.get(
                  "cal_labels_occurrence", False
              ),
          )
          if dataset.labels_occurrence:
              self.labels_occurrence = dataset.labels_occurrence
  
      if hasattr(dataset, "fixed_seq_collate_fn"):
          collate_fn = dataset.fixed_seq_collate_fn
      else:
          collate_fn = dataset.datasets[0].fixed_seq_collate_fn
  
      batch_size = config["batch_size"]
      return torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=batch_size,
          collate_fn=collate_fn,
          drop_last=config.get("drop_last", False),
          shuffle=shuffle,
          num_workers=config.get("num_workers", 0),
          pin_memory=config.get("pin_memory", False),
      )
  
imports: import copy
  import itertools
  from collections import Counter
  from math import ceil
  from typing import Dict, List, Optional, Union
  import librosa
  import numpy
  import soundfile
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from torchmetrics import Accuracy
  from tqdm import tqdm
  from nemo.collections.asr.data.audio_to_label import AudioToSpeechLabelDataset, cache_datastore_manifests
  from nemo.collections.asr.data.audio_to_label_dataset import get_concat_tarred_speech_label_dataset, get_tarred_speech_label_dataset
  from nemo.collections.asr.data.audio_to_text_dataset import convert_to_config_list
  from nemo.collections.asr.models.asr_model import ExportableEncDecModel
  from nemo.collections.asr.parts.preprocessing.features import WaveformFeaturizer
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.common.metrics import TopKClassificationAccuracy
  from nemo.collections.common.parts.preprocessing.collections import ASRSpeechLabel
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import *
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the EncDecSpeakerLabelModel obj's underlying member method code with example usage: obj.__setup_dataloader_from_config(config) and returns: torch, None, None