code: def wavernn_vocode(
      mel_specgram,
      wavernn_checkpoint_name,
      wavernn_loss,
      wavernn_no_mulaw,
      wavernn_no_batch_inference,
      wavernn_batch_timesteps,
      wavernn_batch_overlap,
      device,
      jit,
  ):
      from torchaudio.models import wavernn
  
      sys.path.append(
          os.path.join(os.path.dirname(__file__), "../pipeline_wavernn")
      )
      from processing import NormalizeDB
      from wavernn_inference_wrapper import WaveRNNInferenceWrapper
  
      wavernn_model = wavernn(wavernn_checkpoint_name).eval().to(device)
      wavernn_inference_model = WaveRNNInferenceWrapper(wavernn_model)
  
      if jit:
          wavernn_inference_model = torch.jit.script(
              wavernn_inference_model
          )
  
      # WaveRNN spectro setting for default checkpoint
      # n_fft = 2048
      # n_mels = 80
      # win_length = 1100
      # hop_length = 275
      # f_min = 40
      # f_max = 11025
  
      transforms = torch.nn.Sequential(
          InverseSpectralNormalization(),
          NormalizeDB(min_level_db=-100, normalization=True),
      )
      mel_specgram = transforms(mel_specgram.cpu())
  
      with torch.no_grad():
          waveform = wavernn_inference_model(
              mel_specgram.to(device),
              loss_name=wavernn_loss,
              mulaw=(not wavernn_no_mulaw),
              batched=(not wavernn_no_batch_inference),
              timesteps=wavernn_batch_timesteps,
              overlap=wavernn_batch_overlap,
          )
      return waveform.unsqueeze(0)
  
file_path: audio/examples/pipeline_tacotron2/inference.py
imports: import argparse
  import os
  import random
  import sys
  from functools import partial
  import numpy
  import torch
  import torchaudio
  from datasets import InverseSpectralNormalization
  from text.text_preprocessing import available_phonemizers, available_symbol_set, get_symbol_list, text_to_sequence
  from torchaudio.models import Tacotron2, tacotron2
  from utils import prepare_input_sequence
label_desc: Use image node_id 4 for calling a global function with example usage: wavernn_vocode(mel_specgram, wavernn_checkpoint_name, wavernn_loss, wavernn_no_mulaw, wavernn_no_batch_inference, wavernn_batch_timesteps, wavernn_batch_overlap, device, jit) and returns: waveform