class_docstr: A ready-to-use wrapper for HiFiGAN (mel_spec -> waveform).
  Arguments
  ---------
  hparams
      Hyperparameters (from HyperPyYAML)
  Example
  -------
  >>> tmpdir_vocoder = getfixture('tmpdir') / "vocoder"
  >>> hifi_gan = HIFIGAN.from_hparams(source="speechbrain/tts-hifigan-ljspeech", savedir=tmpdir_vocoder)
  >>> mel_specs = torch.rand(2, 80,298)
  >>> waveforms = hifi_gan.decode_batch(mel_specs)
  >>> # You can use the vocoder coupled with a TTS system
  >>> # Initialize TTS (tacotron2)
  >>> tmpdir_tts = getfixture('tmpdir') / "tts"
  >>> from speechbrain.inference.TTS import Tacotron2
  >>> tacotron2 = Tacotron2.from_hparams(source="speechbrain/tts-tacotron2-ljspeech", savedir=tmpdir_tts)
  >>> # Running the TTS
  >>> mel_output, mel_length, alignment = tacotron2.encode_text("Mary had a little lamb")
  >>> # Running Vocoder (spectrogram-to-waveform)
  >>> waveforms = hifi_gan.decode_batch(mel_output)
class_docstr_tok: ["A","ready-to-use","wrapper","for","HiFiGAN","(","mel_spec","-",">","waveform",")",".","Arguments","--","--","--","--","-","hparams","Hyperparameters","(","from","HyperPyYAML",")","Example","--","--","--","-",">",">",">","tmpdir_vocoder","=","getfixture","(","'tmpdir","'",")","\/","``","vocoder","''",">",">",">","hifi_gan","=","HIFIGAN.from_hparams","(","source=","''","speechbrain\/tts-hifigan-ljspeech","''",",","savedir=tmpdir_vocoder",")",">",">",">","mel_specs","=","torch.rand","(","2",",","80,298",")",">",">",">","waveforms","=","hifi_gan.decode_batch","(","mel_specs",")",">",">",">","#","You","can","use","the","vocoder","coupled","with","a","TTS","system",">",">",">","#","Initialize","TTS","(","tacotron2",")",">",">",">","tmpdir_tts","=","getfixture","(","'tmpdir","'",")","\/","``","tts","''",">",">",">","from","speechbrain.inference.TTS","import","Tacotron2",">",">",">","tacotron2","=","Tacotron2.from_hparams","(","source=","''","speechbrain\/tts-tacotron2-ljspeech","''",",","savedir=tmpdir_tts",")",">",">",">","#","Running","the","TTS",">",">",">","mel_output",",","mel_length",",","alignment","=","tacotron2.encode_text","(","``","Mary","had","a","little","lamb","''",")",">",">",">","#","Running","Vocoder","(","spectrogram-to-waveform",")",">",">",">","waveforms","=","hifi_gan.decode_batch","(","mel_output",")"]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      self.infer = self.hparams.generator.inference
      self.first_call = True
  
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 1 to create a new HIFIGAN object from inherited base classes: Pretrained with example: obj = HIFIGAN()