class_docstr: Simple Checkpoint to save model weights during training. This class is mostly superceded by ModelCheckpoint which provides flexible saving functionality.
  
  :param file: (string):
      file to which model will be saved.
      It can be written 'filename_{epoch}_{loss}' and those
      values will be filled in before saving.
  :param monitor: (string in {'val_loss', 'loss'}):
      whether to monitor train or val loss
  :param save_best_only: (bool):
      whether to only save if monitored value has improved
  :param save_weights_only: (bool):
      whether to save entire model or just weights
      NOTE: only `True` is supported at the moment
  :param max_save: (integer > 0 or -1):
      the max number of models to save. Older model checkpoints
      will be overwritten if necessary. Set equal to -1 to have
      no limit
  :param verbose: (integer in {0, 1}):
      verbosity level
docstr: Saves checkpoint to file
  :param epoch: (int): epoch number
  :param file: (string): file location
  :param is_best: (bool): whether this is the best result seen thus far
  :return:
docstr_tok: ["Saves","checkpoint","to","file",":","param","epoch",":","(","int",")",":","epoch","number",":","param","file",":","(","string",")",":","file","location",":","param","is_best",":","(","bool",")",":","whether","this","is","the","best","result","seen","thus","far",":","return",":"]
code: def save_checkpoint(self, epoch, file, is_best=False):
      """
      Saves checkpoint to file
      :param epoch: (int): epoch number
      :param file: (string): file location
      :param is_best: (bool): whether this is the best result seen thus far
      :return:
      """
      torch.save(
          {
              "epoch": epoch + 1,
              "state_dict": self.trainer.model.state_dict(),
              "optimizer": self.trainer._optimizer.state_dict(),
          },
          file,
      )
      if is_best:
          shutil.copyfile(file, "model_best.pth.tar")
  
file_path: pywick/pywick/callbacks/SimpleModelCheckpoint.py
imports: import os
  import shutil
  import torch
  from .None import Callback
label_desc: Use image node_id 2 for calling the SimpleModelCheckpoint obj's underlying member method code with example usage: obj.save_checkpoint(epoch, file, is_best) without return types