docstr: Load state from a saved checkpoint.
  
  Args:
    save_path (str): The filepath to the saved checkpoint.
    device (torch.device): The device on which to
      load the state.
  
  Returns:
    True if the checkpoint was sucessfully loaded, False if the checkpoint file
      could not be found.
code: def load(
      self, save_path: str, device: Optional[torch.device] = None
  ) -> bool:
      """Load state from a saved checkpoint.
  
      Args:
        save_path (str): The filepath to the saved checkpoint.
        device (torch.device): The device on which to
          load the state.
  
      Returns:
        True if the checkpoint was sucessfully loaded, False if the checkpoint file
          could not be found.
      """
      try:
          state = torch.load(save_path, map_location=device)
          try:
              self.global_step = self._get_global_step(state, save_path)
              _, unexpected_keys = self.model.load_state_dict(
                  state["model_weights"], strict=False
              )
              assert (
                  unexpected_keys == []
              ), f"Unexpected keys found in state dict: {unexpected_keys}"
              if self.optimizer is not None:
                  self.optimizer.load_state_dict(state["optim_state"])
              if (
                  self.scheduler is not None
                  and "scheduler_state" in state
              ):
                  self.scheduler.load_state_dict(
                      state["scheduler_state"]
                  )
              logger.info(
                  f"Successfully loaded model weights from {save_path}."
              )
              return True
          except Exception as e:
              # there was an issue loading the state which means
              # either the model definition and saved weights
              # do not agree or they were not saved in the first
              # place.
              # since this is a severe issue, we raise an error
              # rather than allowing the program to proceed.
              raise e
      except FileNotFoundError as e:
          logger.error(e)
          return False
  
imports: import errno
  import logging
  import os
  import re
  import shutil
  import signal
  import tempfile
  import uuid
  from abc import ABC, abstractmethod
  from glob import glob
  from typing import Any, Dict, Mapping, Optional, Tuple, TYPE_CHECKING
  import torch
  from torch.optim import Optimizer
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.modules.lr_scheduler import LRScheduler
label_desc: Use image node_id 2 for calling the MultiNodeCheckpoint obj's underlying member method code with example usage: obj.load(save_path, device) and returns: True, False