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: Computes waveforms from a single mel-spectrogram
  Arguments
  ---------
  spectrogram: torch.tensor
      mel-spectrogram [mels, time]
  hop_len: int
      hop length used for mel-spectrogram extraction
      same value as in the .yaml file
  fast_sampling: bool
      whether to do fast sampling
  fast_sampling_noise_schedule: list
      the noise schedules used for fast sampling
  Returns
  -------
  waveform: torch.tensor
      waveform [1, time]
  
  audio can be saved by:
  >>> import torchaudio
  >>> waveform = torch.rand(1, 666666)
  >>> sample_rate = 22050
  >>> torchaudio.save(str(getfixture('tmpdir') / "test.wav"), waveform, sample_rate)
docstr_tok: ["Computes","waveforms","from","a","single","mel-spectrogram","Arguments","--","--","--","--","-","spectrogram",":","torch.tensor","mel-spectrogram","[","mels",",","time","]","hop_len",":","int","hop","length","used","for","mel-spectrogram","extraction","same","value","as","in","the",".yaml","file","fast_sampling",":","bool","whether","to","do","fast","sampling","fast_sampling_noise_schedule",":","list","the","noise","schedules","used","for","fast","sampling","Returns","--","--","--","-","waveform",":","torch.tensor","waveform","[","1",",","time","]","audio","can","be","saved","by",":",">",">",">","import","torchaudio",">",">",">","waveform","=","torch.rand","(","1",",","666666",")",">",">",">","sample_rate","=","22050",">",">",">","torchaudio.save","(","str","(","getfixture","(","'tmpdir","'",")","\/","``","test.wav","''",")",",","waveform",",","sample_rate",")"]
code: def decode_spectrogram(
      self,
      spectrogram,
      hop_len,
      fast_sampling=False,
      fast_sampling_noise_schedule=None,
  ):
      """Computes waveforms from a single mel-spectrogram
      Arguments
      ---------
      spectrogram: torch.tensor
          mel-spectrogram [mels, time]
      hop_len: int
          hop length used for mel-spectrogram extraction
          same value as in the .yaml file
      fast_sampling: bool
          whether to do fast sampling
      fast_sampling_noise_schedule: list
          the noise schedules used for fast sampling
      Returns
      -------
      waveform: torch.tensor
          waveform [1, time]
  
      audio can be saved by:
      >>> import torchaudio
      >>> waveform = torch.rand(1, 666666)
      >>> sample_rate = 22050
      >>> torchaudio.save(str(getfixture('tmpdir') / "test.wav"), waveform, sample_rate)
      """
      with torch.no_grad():
          waveform = self.infer(
              unconditional=False,
              scale=hop_len,
              condition=spectrogram.unsqueeze(0).to(self.device),
              fast_sampling=fast_sampling,
              fast_sampling_noise_schedule=fast_sampling_noise_schedule,
          )
      return waveform.squeeze(0)
  
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 4 for calling the DiffWaveVocoder obj's underlying member method code with example usage: obj.decode_spectrogram(spectrogram, hop_len, fast_sampling, fast_sampling_noise_schedule) and returns: waveform