class_docstr: HiFi-GAN model (https://arxiv.org/abs/2010.05646) that is used to generate audio from mel spectrogram.
class_docstr_tok: ["HiFi-GAN","model","(","https",":","\/\/arxiv.org\/abs\/2010.05646",")","that","is","used","to","generate","audio","from","mel","spectrogram","."]
code: def _bias_denoise(self, audio, mel):
      def stft(x):
          comp = torch.stft(
              x.squeeze(1),
              n_fft=1024,
              hop_length=256,
              win_length=1024,
              return_complex=True,
          )
          comp = torch.view_as_real(comp)
          real, imag = comp[..., 0], comp[..., 1]
          mags = torch.sqrt(real**2 + imag**2)
          phase = torch.atan2(imag, real)
          return mags, phase
  
      def istft(mags, phase):
          comp = torch.stack(
              [mags * torch.cos(phase), mags * torch.sin(phase)], dim=-1
          )
          x = torch.istft(
              torch.view_as_complex(comp),
              n_fft=1024,
              hop_length=256,
              win_length=1024,
          )
          return x
  
      # Create bias tensor
      if (
          self.stft_bias is None
          or self.stft_bias.shape[0] != audio.shape[0]
      ):
          audio_bias = self(
              spec=torch.zeros_like(mel, device=mel.device)
          )
          self.stft_bias, _ = stft(audio_bias)
          self.stft_bias = self.stft_bias[:, :, 0][:, :, None]
  
      audio_mags, audio_phase = stft(audio)
      audio_mags = (
          audio_mags
          - self.cfg.get("denoise_strength", 0.0025) * self.stft_bias
      )
      audio_mags = torch.clamp(audio_mags, 0.0)
      audio_denoised = istft(audio_mags, audio_phase).unsqueeze(1)
  
      return audio_denoised
  
imports: import itertools
  from pathlib import Path
  import torch
  import torch.nn.functional
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning.loggers.wandb import WandbLogger
  from nemo.collections.tts.losses.hifigan_losses import DiscriminatorLoss, FeatureMatchingLoss, GeneratorLoss
  from nemo.collections.tts.models.base import Vocoder
  from nemo.collections.tts.modules.hifigan_modules import MultiPeriodDiscriminator, MultiScaleDiscriminator
  from nemo.collections.tts.parts.utils.callbacks import LoggingCallback
  from nemo.collections.tts.parts.utils.helpers import get_batch_size, get_num_workers, plot_spectrogram_to_numpy
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import AudioSignal, MelSpectrogramType
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.core.optim.lr_scheduler import compute_max_steps, prepare_lr_scheduler
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 12 for calling the HifiGanModel obj's underlying member method code with example usage: obj._bias_denoise(audio, mel) and returns: audio_denoised, mags,  phase, x