class_docstr: WaveGrad Dataset searchs for all the wav files under root path
  and converts them to acoustic features on the fly and returns
  random segments of (audio, feature) couples.
class_docstr_tok: ["WaveGrad","Dataset","searchs","for","all","the","wav","files","under","root","path","and","converts","them","to","acoustic","features","on","the","fly","and","returns","random","segments","of","(","audio",",","feature",")","couples","."]
docstr: load (audio, feat) couple 
docstr_tok: ["load","(","audio",",","feat",")","couple"]
code: def load_item(self, idx):
      """load (audio, feat) couple"""
      # compute features from wav
      wavpath = self.item_list[idx]
  
      if self.use_cache and self.cache[idx] is not None:
          audio = self.cache[idx]
      else:
          audio = self.ap.load_wav(wavpath)
  
          if self.return_segments:
              # correct audio length wrt segment length
              if audio.shape[-1] < self.seq_len + self.pad_short:
                  audio = np.pad(
                      audio,
                      (0, self.seq_len + self.pad_short - len(audio)),
                      mode="constant",
                      constant_values=0.0,
                  )
              assert (
                  audio.shape[-1] >= self.seq_len + self.pad_short
              ), f"{audio.shape[-1]} vs {self.seq_len + self.pad_short}"
  
          # correct the audio length wrt hop length
          p = (
              audio.shape[-1] // self.hop_len + 1
          ) * self.hop_len - audio.shape[-1]
          audio = np.pad(
              audio, (0, p), mode="constant", constant_values=0.0
          )
  
          if self.use_cache:
              self.cache[idx] = audio
  
      if self.return_segments:
          max_start = len(audio) - self.seq_len
          start = random.randint(0, max_start)
          end = start + self.seq_len
          audio = audio[start:end]
  
      if (
          self.use_noise_augment
          and self.is_training
          and self.return_segments
      ):
          audio = audio + (1 / 32768) * torch.randn_like(audio)
  
      mel = self.ap.melspectrogram(audio)
      mel = mel[..., :-1]  # ignore the padding
  
      audio = torch.from_numpy(audio).float()
      mel = torch.from_numpy(mel).float().squeeze(0)
      return (mel, audio)
  
file_path: TTS/TTS/vocoder/datasets/wavegrad_dataset.py
imports: import os
  import glob
  import torch
  import random
  import numpy
  from torch.utils.data import Dataset
  from multiprocessing import Manager
label_desc: Use image node_id 7 for calling the WaveGradDataset obj's underlying member method code with example usage: obj.load_item(idx) and returns: mel,  audio