class_docstr: Base class for encoder-decoder models used for self-supervised encoder pre-training
class_docstr_tok: ["Base","class","for","encoder-decoder","models","used","for","self-supervised","encoder","pre-training"]
code: def _setup_dataloader_from_config(self, config: Optional[Dict]):
      if "augmentor" in config:
          augmentor = process_augmentations(config["augmentor"])
      else:
          augmentor = None
  
      # Automatically inject args from model config to dataloader config
      audio_to_text_dataset.inject_dataloader_value_from_model_config(
          self.cfg, config, key="sample_rate"
      )
  
      if config.get("use_lhotse"):
          return get_lhotse_dataloader_from_config(
              config,
              global_rank=self.global_rank,
              world_size=self.world_size,
              dataset=LhotseSpeechToTextBpeDataset(
                  tokenizer=make_parser(
                      labels=config.get("labels", None),
                      name=config.get("parser", "en"),
                      unk_id=config.get("unk_index", -1),
                      blank_id=config.get("blank_index", -1),
                      do_normalize=config.get(
                          "normalize_transcripts", False
                      ),
                  ),
              ),
          )
  
      shuffle = config["shuffle"]
      device = "gpu" if torch.cuda.is_available() else "cpu"
      if config.get("use_dali", False):
          device_id = self.local_rank if device == "gpu" else None
          dataset = audio_to_text_dataset.get_dali_char_dataset(
              config=config,
              shuffle=shuffle,
              device_id=device_id,
              global_rank=self.global_rank,
              world_size=self.world_size,
              preprocessor_cfg=self._cfg.preprocessor,
          )
          return dataset
  
      # Instantiate tarred dataset loader or normal dataset loader
      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
          )
          dataset = audio_to_text_dataset.get_tarred_dataset(
              config=config,
              shuffle_n=shuffle_n,
              global_rank=self.global_rank,
              world_size=self.world_size,
              augmentor=augmentor,
          )
          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 = audio_to_text_dataset.get_char_dataset(
              config=config, augmentor=augmentor
          )
  
      if hasattr(dataset, "collate_fn"):
          collate_fn = dataset.collate_fn
      elif hasattr(dataset.datasets[0], "collate_fn"):
          # support datasets that are lists of entries
          collate_fn = dataset.datasets[0].collate_fn
      else:
          # support datasets that are lists of lists
          collate_fn = dataset.datasets[0].datasets[0].collate_fn
  
      return torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=config["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: from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  import torch.nn
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
  from nemo.collections.common.parts.preprocessing.parsers import make_parser
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin, set_access_cfg
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LabelsType, LengthsType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the SpeechEncDecSelfSupervisedModel obj's underlying member method code with example usage: obj._setup_dataloader_from_config(config) and returns: torch, get_lhotse_dataloader_from_config, dataset, None, None