code: def load_state_dict(self):
      ckpt_config = self.config.checkpoint
  
      suffix = (
          "best.ckpt" if ckpt_config.resume_best else "current.ckpt"
      )
      reverse_suffix = (
          "best.ckpt" if not ckpt_config.resume_best else "current.ckpt"
      )
      ckpt_filepath = os.path.join(
          self.ckpt_foldername, self.ckpt_prefix + suffix
      )
  
      # In case of interrupts and resume, ckpt_config.resume_file would be there
      # But, if the checkpoints are already created in the save dir
      # and resume is true signifying the interrupt resume, we should skip
      # loading the resume file.
      if (
          ckpt_config.resume_file is not None
          or ckpt_config.resume_zoo is not None
      ) and (
          not ckpt_config.resume
          or not PathManager.exists(ckpt_filepath)
      ):
          if ckpt_config.resume_file and PathManager.exists(
              ckpt_config.resume_file
          ):
              self._load(
                  ckpt_config.resume_file,
                  load_pretrained=ckpt_config.resume_pretrained,
              )
              return
          # resume_file doesn't exist, try from zoo now
          elif ckpt_config.resume_zoo is not None:
              self._load(
                  ckpt_config.resume_zoo,
                  load_zoo=True,
                  load_pretrained=ckpt_config.resume_pretrained,
              )
              return
          else:
              raise RuntimeError(
                  f"{ckpt_config.resume_file} doesn't exist"
              )
  
      if ckpt_config.resume:
          if PathManager.exists(ckpt_filepath):
              self._load(ckpt_filepath)
          else:
              warnings.warn(
                  "Tried to resume but checkpoint filepath {} "
                  "is not present. Trying {}, otherwise skipping.".format(
                      ckpt_filepath, reverse_suffix
                  )
              )
              ckpt_filepath = ckpt_filepath.replace(
                  suffix, reverse_suffix
              )
              if PathManager.exists(ckpt_filepath):
                  self._load(ckpt_filepath)
  
imports: import glob
  import importlib
  import logging
  import os
  import sys
  import warnings
  from typing import Any, Dict
  import torch
  from mmf.common.registry import registry
  from mmf.utils.checkpoint_updater import get_pretrained_state_mapping_checkpoint
  from mmf.utils.configuration import get_mmf_env, load_yaml
  from mmf.utils.distributed import is_main, is_xla, open_if_main, synchronize
  from mmf.utils.download import download_pretrained_model
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_current_device, updir
  from mmf.utils.xla import save_xla_ckpt
  from omegaconf import OmegaConf
label_desc: Use image node_id 3 for calling the Checkpoint obj's underlying member method code with example usage: obj.load_state_dict() without return types