class_docstr: Iteration-based Runner.
  
  This runner train models iteration by iteration.
class_docstr_tok: ["Iteration-based","Runner",".","This","runner","train","models","iteration","by","iteration","."]
docstr: Save checkpoint to file.
  
  Args:
      out_dir (str): Directory to save checkpoint files.
      filename_tmpl (str, optional): Checkpoint file template.
          Defaults to 'iter_{}.pth'.
      meta (dict, optional): Metadata to be saved in checkpoint.
          Defaults to None.
      save_optimizer (bool, optional): Whether save optimizer.
          Defaults to True.
      create_symlink (bool, optional): Whether create symlink to the
          latest checkpoint file. Defaults to True.
docstr_tok: ["Save","checkpoint","to","file",".","Args",":","out_dir","(","str",")",":","Directory","to","save","checkpoint","files",".","filename_tmpl","(","str",",","optional",")",":","Checkpoint","file","template",".","Defaults","to","'iter_","{","}",".pth","'",".","meta","(","dict",",","optional",")",":","Metadata","to","be","saved","in","checkpoint",".","Defaults","to","None",".","save_optimizer","(","bool",",","optional",")",":","Whether","save","optimizer",".","Defaults","to","True",".","create_symlink","(","bool",",","optional",")",":","Whether","create","symlink","to","the","latest","checkpoint","file",".","Defaults","to","True","."]
code: def save_checkpoint(
      self,
      out_dir,
      filename_tmpl="iter_{}.pth",
      meta=None,
      save_optimizer=True,
      create_symlink=True,
  ):
      """Save checkpoint to file.
  
      Args:
          out_dir (str): Directory to save checkpoint files.
          filename_tmpl (str, optional): Checkpoint file template.
              Defaults to 'iter_{}.pth'.
          meta (dict, optional): Metadata to be saved in checkpoint.
              Defaults to None.
          save_optimizer (bool, optional): Whether save optimizer.
              Defaults to True.
          create_symlink (bool, optional): Whether create symlink to the
              latest checkpoint file. Defaults to True.
      """
      if meta is None:
          meta = {}
      elif not isinstance(meta, dict):
          raise TypeError(
              f"meta should be a dict or None, but got {type(meta)}"
          )
      if self.meta is not None:
          meta.update(self.meta)
          # Note: meta.update(self.meta) should be done before
          # meta.update(epoch=self.epoch + 1, iter=self.iter) otherwise
          # there will be problems with resumed checkpoints.
          # More details in https://github.com/open-mmlab/mmcv/pull/1108
      meta.update(epoch=self.epoch + 1, iter=self.iter)
  
      filename = filename_tmpl.format(self.iter + 1)
      filepath = osp.join(out_dir, filename)
      optimizer = self.optimizer if save_optimizer else None
      save_checkpoint(
          self.model, filepath, optimizer=optimizer, meta=meta
      )
      # in some environments, `os.symlink` is not supported, you may need to
      # set `create_symlink` to False
      if create_symlink:
          dst_file = osp.join(out_dir, "latest.pth")
          if platform.system() != "Windows":
              mmcv.symlink(filename, dst_file)
          else:
              shutil.copy(filepath, dst_file)
  
imports: import os.path
  import platform
  import shutil
  import time
  import warnings
  import torch
  from torch.optim import Optimizer
  import annotator.uniformer.mmcv
  from .base_runner import BaseRunner
  from .builder import RUNNERS
  from .checkpoint import save_checkpoint
  from .hooks import IterTimerHook
  from .utils import get_host_info
label_desc: Use image node_id 5 for calling the IterBasedRunner obj's underlying member method code with example usage: obj.save_checkpoint(out_dir, filename_tmpl, meta, save_optimizer, create_symlink) without return types