class_docstr: WaveGlow model (https://arxiv.org/abs/1811.00002) that is used to generate audio from mel spectrogram.
class_docstr_tok: ["WaveGlow","model","(","https",":","\/\/arxiv.org\/abs\/1811.00002",")","that","is","used","to","generate","audio","from","mel","spectrogram","."]
code: def forward(self, *, audio, audio_len, run_inverse=True):
      if self.mode != self.waveglow.mode:
          raise ValueError(
              f"WaveGlowModel's mode {self.mode} does not match WaveGlowModule's mode {self.waveglow.mode}"
          )
      spec, spec_len = self.audio_to_melspec_precessor(audio, audio_len)
      tensors = self.waveglow(
          spec=spec,
          audio=audio,
          run_inverse=run_inverse,
          sigma=self.sigma,
      )
      if self.mode == OperationMode.training:
          return tensors[:-1]  # z, log_s_list, log_det_W_list
      elif self.mode == OperationMode.validation:
          z, log_s_list, log_det_W_list, audio_pred = tensors
          return (
              z,
              log_s_list,
              log_det_W_list,
              audio_pred,
              spec,
              spec_len,
          )
      return tensors
  
imports: import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, open_dict
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.tts.losses.waveglowloss import WaveGlowLoss
  from nemo.collections.tts.models.base import GlowVocoder
  from nemo.collections.tts.parts.utils.helpers import OperationMode, waveglow_log_to_tb_func
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import AudioSignal, LengthsType, LogDeterminantType, MelSpectrogramType, NormalDistributionSamplesType, VoidType
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 3 for calling the WaveGlowModel obj's underlying member method code with example usage: obj.forward() and returns: tensors, tensors, z,  log_s_list,  log_det_W_list,  audio_pred,  spec,  spec_len