docstr: Saving checkpoints
  
  :param epoch: current epoch number
  :param log: logging information of the epoch
  :param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar'
docstr_tok: ["Saving","checkpoints",":","param","epoch",":","current","epoch","number",":","param","log",":","logging","information","of","the","epoch",":","param","save_best",":","if","True",",","rename","the","saved","checkpoint","to","'model_best.pth.tar","'"]
code: def _save_checkpoint(self, epoch, file_name):
      """
      Saving checkpoints
  
      :param epoch: current epoch number
      :param log: logging information of the epoch
      :param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar'
      """
      state_dict = self.model.state_dict()
      state = {
          "epoch": epoch,
          "global_step": self.global_step,
          "state_dict": state_dict,
          "optimizer": self.optimizer.state_dict(),
          "config": self.config,
          "metrics": self.metrics,
      }
      filename = os.path.join(self.checkpoint_dir, file_name)
      paddle.save(state, filename)
  
imports: import os
  import pathlib
  import shutil
  from pprint import pformat
  import anyconfig
  import paddle
  import numpy
  import random
  from paddle.jit import to_static
  from paddle.static import InputSpec
  from utils import setup_logger
label_desc: Use image node_id 8 for calling the BaseTrainer obj's underlying member method code with example usage: obj._save_checkpoint(epoch, file_name) without return types