code: def _load(
      self, file, force=False, load_zoo=False, load_pretrained=False
  ):
      ckpt_config = self.config.checkpoint
      logger.info("Loading checkpoint")
      if load_zoo:
          ckpt, should_continue = self._load_from_zoo(file)
          if not should_continue:
              return
      else:
          ckpt = self._torch_load(file)
  
      pretrained_state_mapping = ckpt_config.pretrained_state_mapping
  
      if not load_pretrained or force is True:
          pretrained_state_mapping = {}
  
      if not self._is_pl_trainer_checkpoint(ckpt):
          if "model" not in ckpt:
              ckpt = {"model": ckpt}
          state_dict = self.upgrade_state_dict(ckpt["model"])
      else:
          state_dict = self.upgrade_state_dict(ckpt["state_dict"])
  
      if len(pretrained_state_mapping.items()) == 0:
          incompatible_keys = self.trainer.model.load_state_dict(
              state_dict, strict=False
          )
          if len(incompatible_keys.missing_keys) != 0:
              logger.warning(
                  f"Missing keys {incompatible_keys.missing_keys} in the"
                  + " checkpoint.\n"
                  + "If this is not your checkpoint, please open up an "
                  + "issue on MMF GitHub. \n"
                  + f"Unexpected keys if any: {incompatible_keys.unexpected_keys}"
              )
  
          if len(incompatible_keys.unexpected_keys) != 0:
              logger.warning(
                  "Unexpected keys in state dict: "
                  + f"{incompatible_keys.unexpected_keys} \n"
                  + "This is usually not a problem with pretrained models, but "
                  + "if this is your own model, please double check. \n"
                  + "If you think this is an issue, please open up a "
                  + "bug at MMF GitHub."
              )
  
          reset_optimizer = (
              ckpt_config.reset.optimizer or ckpt_config.reset.all
          )
          if not reset_optimizer:
              self._load_optimizer(ckpt)
  
          reset_counts = (
              ckpt_config.reset.all or ckpt_config.reset.counts
          )
          if not reset_counts:
              self.trainer.early_stop_callback.early_stopping.init_from_checkpoint(
                  ckpt
              )
              self._load_counts_and_lr_scheduler(ckpt)
  
          reset_scaler = (
              ckpt_config.reset.all or ckpt_config.reset.fp16_scaler
          )
          if not reset_scaler:
              self._load_fp16_scaler(ckpt)
      else:
          self._load_pretrained(state_dict)
  
      logger.info("Checkpoint loaded.")
      logger.info(f"Current num updates: {self.trainer.num_updates}")
      logger.info(
          f"Current iteration: {self.trainer.current_iteration}"
      )
      logger.info(f"Current epoch: {self.trainer.current_epoch}")
  
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 5 for calling the Checkpoint obj's underlying member method code with example usage: obj._load(file, force, load_zoo, load_pretrained) without return types