class_docstr: FastPitch model (https://arxiv.org/abs/2006.06873) that is used to generate mel spectrogram from text.
class_docstr_tok: ["FastPitch","model","(","https",":","\/\/arxiv.org\/abs\/2006.06873",")","that","is","used","to","generate","mel","spectrogram","from","text","."]
code: def __setup_dataloader_from_config(
      self, cfg, shuffle_should_be: bool = True, name: str = "train"
  ):
      if "dataset" not in cfg or not isinstance(
          cfg.dataset, DictConfig
      ):
          raise ValueError(f"No dataset for {name}")
      if "dataloader_params" not in cfg or not isinstance(
          cfg.dataloader_params, DictConfig
      ):
          raise ValueError(f"No dataloader_params for {name}")
      if shuffle_should_be:
          if "shuffle" not in cfg.dataloader_params:
              logging.warning(
                  f"Shuffle should be set to True for {self}'s {name} dataloader but was not found in its "
                  "config. Manually setting to True"
              )
              with open_dict(cfg.dataloader_params):
                  cfg.dataloader_params.shuffle = True
          elif not cfg.dataloader_params.shuffle:
              logging.error(
                  f"The {name} dataloader for {self} has shuffle set to False!!!"
              )
      elif cfg.dataloader_params.shuffle:
          logging.error(
              f"The {name} dataloader for {self} has shuffle set to True!!!"
          )
  
      if (
          self.ds_class
          == "nemo.collections.tts.data.dataset.TTSDataset"
      ):
          phon_mode = contextlib.nullcontext()
          if hasattr(self.vocab, "set_phone_prob"):
              phon_mode = self.vocab.set_phone_prob(
                  prob=None
                  if name == "val"
                  else self.vocab.phoneme_probability
              )
  
          with phon_mode:
              dataset = instantiate(
                  cfg.dataset,
                  text_normalizer=self.normalizer,
                  text_normalizer_call_kwargs=self.text_normalizer_call_kwargs,
                  text_tokenizer=self.vocab,
              )
      else:
          dataset = instantiate(cfg.dataset)
  
      return torch.utils.data.DataLoader(
          dataset,
          collate_fn=dataset.collate_fn,
          **cfg.dataloader_params,
      )
  
imports: import contextlib
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import List, Optional
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.common.parts.preprocessing import parsers
  from nemo.collections.tts.losses.aligner_loss import BinLoss, ForwardSumLoss
  from nemo.collections.tts.losses.fastpitchloss import DurationLoss, EnergyLoss, MelLoss, PitchLoss
  from nemo.collections.tts.models.base import SpectrogramGenerator
  from nemo.collections.tts.modules.fastpitch import FastPitchModule
  from nemo.collections.tts.parts.mixins import FastPitchAdapterModelMixin
  from nemo.collections.tts.parts.utils.callbacks import LoggingCallback
  from nemo.collections.tts.parts.utils.helpers import batch_from_ragged, g2p_backward_compatible_support, plot_alignment_to_numpy, plot_spectrogram_to_numpy, process_batch, sample_tts_input
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import Index, LengthsType, MelSpectrogramType, ProbsType, RegressionValuesType, TokenDurationType, TokenIndex, TokenLogDurationType
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 15 for calling the FastPitchModel obj's underlying member method code with example usage: obj.__setup_dataloader_from_config(cfg, shuffle_should_be, name) and returns: torch