code: def save_checkpoint(
      model, optimizer, model_loss, out_path, current_step, epoch
  ):
      checkpoint_path = "checkpoint_{}.pth.tar".format(current_step)
      checkpoint_path = os.path.join(out_path, checkpoint_path)
      print(" | | > Checkpoint saving : {}".format(checkpoint_path))
  
      new_state_dict = model.state_dict()
      state = {
          "model": new_state_dict,
          "optimizer": optimizer.state_dict()
          if optimizer is not None
          else None,
          "step": current_step,
          "epoch": epoch,
          "loss": model_loss,
          "date": datetime.date.today().strftime("%B %d, %Y"),
      }
      torch.save(state, checkpoint_path)
  
file_path: TTS/TTS/speaker_encoder/utils/generic_utils.py
imports: import datetime
  import os
  import re
  import torch
  from TTS.speaker_encoder.model import SpeakerEncoder
  from TTS.utils.generic_utils import check_argument
label_desc: Use image node_id 3 for calling a global function with example usage: save_checkpoint(model, optimizer, model_loss, out_path, current_step, epoch) without return types