code: def test_pretrained_load(self):
      with mock_env_with_temp() as d:
          checkpoint = Checkpoint(self.trainer)
          self._init_early_stopping(checkpoint)
          self._do_a_pass()
          original_model = deepcopy(self.trainer.model)
          # Test with zoo now
          ret_load_pretrained_zoo = {
              "config": self.config.model_config,
              "checkpoint": deepcopy(self.trainer.model.state_dict()),
              "full_config": self.config,
          }
  
          checkpoint.save(2000)
          self.trainer.config.checkpoint.resume_file = os.path.join(
              d, "current.ckpt"
          )
          self.trainer.config.checkpoint.resume_pretrained = True
          self.trainer.model = OnlyBase()
          checkpoint.load_state_dict()
  
          self.assertTrue(
              compare_state_dicts(
                  self.trainer.model.base_test.state_dict(),
                  original_model.base.state_dict(),
              )
          )
  
          with patch(
              "mmf.utils.checkpoint.load_pretrained_model",
              return_value=ret_load_pretrained_zoo,
          ):
              self.trainer.config.checkpoint.resume_zoo = "random"
              self.trainer.config.checkpoint.resume_file = None
              self.trainer.model = OnlyBase()
              checkpoint.load_state_dict()
  
              self.assertTrue(
                  compare_state_dicts(
                      self.trainer.model.base_test.state_dict(),
                      original_model.base.state_dict(),
                  )
              )
  
imports: import contextlib
  import os
  import tempfile
  import unittest
  from copy import deepcopy
  from io import StringIO
  from unittest.mock import Mock, patch
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.trainers.callbacks.checkpoint import CheckpointCallback
  from mmf.trainers.callbacks.early_stopping import EarlyStoppingCallback
  from mmf.trainers.callbacks.lr_scheduler import LRSchedulerCallback
  from mmf.utils.checkpoint import Checkpoint
  from mmf.utils.configuration import load_yaml
  from mmf.utils.file_io import PathManager
  from omegaconf import OmegaConf
  from tests.test_utils import compare_state_dicts, skip_if_no_cuda
label_desc: Use image node_id 10 for calling the TestUtilsCheckpoint obj's underlying member method code with example usage: obj.test_pretrained_load() without return types