code: def test_loader(self):
      for dataset_config in dataset_configs:
          dataloader, _ = self._create_dataloader(
              1, 1, 0, dataset_config, preprocess_samples=True
          )
          for i, data in enumerate(dataloader):
              if i == self.max_loader_iter:
                  break
              text_input = data["token_id"]
              _ = data["token_id_lengths"]
              speaker_name = data["speaker_names"]
              linear_input = data["linear"]
              mel_input = data["mel"]
              mel_lengths = data["mel_lengths"]
              _ = data["stop_targets"]
              _ = data["item_idxs"]
              wavs = data["waveform"]
  
              neg_values = text_input[text_input < 0]
              check_count = len(neg_values)
  
              # check basic conditions
              self.assertEqual(check_count, 0)
              self.assertEqual(
                  linear_input.shape[0],
                  mel_input.shape[0],
                  c.batch_size,
              )
              self.assertEqual(
                  linear_input.shape[2], self.ap.fft_size // 2 + 1
              )
              self.assertEqual(mel_input.shape[2], c.audio["num_mels"])
              self.assertEqual(
                  wavs.shape[1], mel_input.shape[1] * c.audio.hop_length
              )
              self.assertIsInstance(speaker_name[0], str)
  
              # make sure that the computed mels and the waveform match and correctly computed
              mel_new = self.ap.melspectrogram(
                  wavs[0].squeeze().numpy()
              )
              # guarantee that both mel-spectrograms have the same size and that we will remove waveform padding
              mel_new = mel_new[:, : mel_lengths[0]]
              ignore_seg = -(
                  1 + c.audio.win_length // c.audio.hop_length
              )
              mel_diff = (
                  mel_new[:, : mel_input.shape[1]]
                  - mel_input[0].T.numpy()
              )[:, 0:ignore_seg]
              self.assertLess(abs(mel_diff.sum()), 1e-5)
  
              # check normalization ranges
              if self.ap.symmetric_norm:
                  self.assertLessEqual(
                      mel_input.max(), self.ap.max_norm
                  )
                  self.assertGreaterEqual(
                      mel_input.min(),
                      -self.ap.max_norm,  # pylint: disable=invalid-unary-operand-type
                  )
                  self.assertLess(mel_input.min(), 0)
              else:
                  self.assertLessEqual(
                      mel_input.max(), self.ap.max_norm
                  )
                  self.assertGreaterEqual(mel_input.min(), 0)
  
file_path: TTS/tests/data_tests/test_loader.py
imports: import os
  import shutil
  import unittest
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from tests import get_tests_data_path, get_tests_output_path
  from TTS.tts.configs.shared_configs import BaseDatasetConfig, BaseTTSConfig
  from TTS.tts.datasets import TTSDataset, load_tts_samples
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.utils.audio import AudioProcessor
label_desc: Use image node_id 3 for calling the TestTTSDataset obj's underlying member method code with example usage: obj.test_loader() without return types