class_docstr: A ready-to-use inference wrapper for DiffWave as vocoder.
  The wrapper allows to perform generative tasks:
      locally-conditional generation: mel_spec -> waveform
  Arguments
  ---------
  hparams
      Hyperparameters (from HyperPyYAML)
class_docstr_tok: ["A","ready-to-use","inference","wrapper","for","DiffWave","as","vocoder",".","The","wrapper","allows","to","perform","generative","tasks",":","locally-conditional","generation",":","mel_spec","-",">","waveform","Arguments","--","--","--","--","-","hparams","Hyperparameters","(","from","HyperPyYAML",")"]
docstr: Generate waveforms from spectrograms
  Arguments
  ---------
  mel: torch.tensor
      spectrogram [batch, mels, time]
  hop_len: int
      Hop length during mel-spectrogram extraction
      Should be the same value as in the .yaml file
      Used to determine the output wave length
      Also used to mask the noise for vocoding task
  mel_lens: torch.tensor
      Used to mask the noise caused by padding
      A list of lengths of mel-spectrograms for the batch
      Can be obtained from the output of Tacotron/FastSpeech
  fast_sampling: bool
      whether to do fast sampling
  fast_sampling_noise_schedule: list
      the noise schedules used for fast sampling
  Returns
  -------
  waveforms: torch.tensor
      Batch of mel-waveforms [batch, 1, time]
docstr_tok: ["Generate","waveforms","from","spectrograms","Arguments","--","--","--","--","-","mel",":","torch.tensor","spectrogram","[","batch",",","mels",",","time","]","hop_len",":","int","Hop","length","during","mel-spectrogram","extraction","Should","be","the","same","value","as","in","the",".yaml","file","Used","to","determine","the","output","wave","length","Also","used","to","mask","the","noise","for","vocoding","task","mel_lens",":","torch.tensor","Used","to","mask","the","noise","caused","by","padding","A","list","of","lengths","of","mel-spectrograms","for","the","batch","Can","be","obtained","from","the","output","of","Tacotron\/FastSpeech","fast_sampling",":","bool","whether","to","do","fast","sampling","fast_sampling_noise_schedule",":","list","the","noise","schedules","used","for","fast","sampling","Returns","--","--","--","-","waveforms",":","torch.tensor","Batch","of","mel-waveforms","[","batch",",","1",",","time","]"]
code: def decode_batch(
      self,
      mel,
      hop_len,
      mel_lens=None,
      fast_sampling=False,
      fast_sampling_noise_schedule=None,
  ):
      """Generate waveforms from spectrograms
      Arguments
      ---------
      mel: torch.tensor
          spectrogram [batch, mels, time]
      hop_len: int
          Hop length during mel-spectrogram extraction
          Should be the same value as in the .yaml file
          Used to determine the output wave length
          Also used to mask the noise for vocoding task
      mel_lens: torch.tensor
          Used to mask the noise caused by padding
          A list of lengths of mel-spectrograms for the batch
          Can be obtained from the output of Tacotron/FastSpeech
      fast_sampling: bool
          whether to do fast sampling
      fast_sampling_noise_schedule: list
          the noise schedules used for fast sampling
      Returns
      -------
      waveforms: torch.tensor
          Batch of mel-waveforms [batch, 1, time]
  
      """
      with torch.no_grad():
          waveform = self.infer(
              unconditional=False,
              scale=hop_len,
              condition=mel.to(self.device),
              fast_sampling=fast_sampling,
              fast_sampling_noise_schedule=fast_sampling_noise_schedule,
          )
  
      # Mask the noise caused by padding during batch inference
      if mel_lens is not None and hop_len is not None:
          waveform = self.mask_noise(waveform, mel_lens, hop_len)
      return waveform
  
imports: import logging
  import torch
  from speechbrain.dataio.dataio import length_to_mask
  from speechbrain.inference.interfaces import Pretrained
label_desc: Use image node_id 2 for calling the DiffWaveVocoder obj's underlying member method code with example usage: obj.decode_batch(mel, hop_len, mel_lens, fast_sampling, fast_sampling_noise_schedule) and returns: waveform