code: def save_model(
      model,
      optimizer,
      scheduler,
      model_disc,
      optimizer_disc,
      scheduler_disc,
      current_step,
      epoch,
      output_path,
      **kwargs,
  ):
      if hasattr(model, "module"):
          model_state = model.module.state_dict()
      else:
          model_state = model.state_dict()
      model_disc_state = (
          model_disc.state_dict() if model_disc is not None else None
      )
      optimizer_state = (
          optimizer.state_dict() if optimizer is not None else None
      )
      optimizer_disc_state = (
          optimizer_disc.state_dict()
          if optimizer_disc is not None
          else None
      )
      scheduler_state = (
          scheduler.state_dict() if scheduler is not None else None
      )
      scheduler_disc_state = (
          scheduler_disc.state_dict()
          if scheduler_disc is not None
          else None
      )
      state = {
          "model": model_state,
          "optimizer": optimizer_state,
          "scheduler": scheduler_state,
          "model_disc": model_disc_state,
          "optimizer_disc": optimizer_disc_state,
          "scheduler_disc": scheduler_disc_state,
          "step": current_step,
          "epoch": epoch,
          "date": datetime.date.today().strftime("%B %d, %Y"),
      }
      state.update(kwargs)
      torch.save(state, output_path)
  
file_path: TTS/TTS/vocoder/utils/io.py
imports: import os
  import torch
  import datetime
  import pickle
  from TTS.utils.io import RenamingUnpickler
label_desc: Use image node_id 2 for calling a global function with example usage: save_model(model, optimizer, scheduler, model_disc, optimizer_disc, scheduler_disc, current_step, epoch, output_path) without return types