docstr: TODO
          
docstr_tok: ["TODO"]
code: def forward(
      self, spec, z=None, audio=None, run_inverse=True, sigma=1.0
  ):
      """TODO"""
      if self.training and self.mode != OperationMode.training:
          raise ValueError(
              f"{self} has self.training set to True but self.OperationMode was not set to training"
          )
      if not self.training and self.mode == OperationMode.training:
          raise ValueError(
              f"{self} has self.training set to False but self.OperationMode was set to training"
          )
  
      audio_pred = torch.zeros((1, 1))
      if run_inverse:
          # norm_dist_to_audio is used to predict audio from spectrogram so only used in val or infer mode
          # Could also log train audio but currently not done
          audio_pred = self.norm_dist_to_audio(
              spec=spec, sigma=sigma, z=z
          )
  
      if audio is not None and self.mode != OperationMode.infer:
          # audio_to_normal_dist is used to calculate loss so only run this in train or val model
          z1, log_s_list, log_det_W_list = self.audio_to_normal_dist(
              spec=spec, audio=audio
          )
          return z1, log_s_list, log_det_W_list, audio_pred
  
      return audio_pred
  
file_path: NeMo/nemo/collections/tts/modules/waveglow.py
imports: from typing import Tuple
  import torch
  from nemo.collections.tts.modules.submodules import Invertible1x1Conv, WaveNet
  from nemo.collections.tts.parts.utils.helpers import OperationMode, remove, split_view
  from nemo.core.classes import Exportable, NeuralModule, typecheck
  from nemo.core.neural_types.elements import AudioSignal, IntType, MelSpectrogramType, NormalDistributionSamplesType, VoidType
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 3 for calling the WaveGlowModule obj's underlying member method code with example usage: obj.forward(spec, z, audio, run_inverse, sigma) and returns: audio_pred, z1,  log_s_list,  log_det_W_list,  audio_pred