class_docstr: The abstract dist sparse optimizer.
  
  Note: dgl dist sparse optimizer only work with dgl.distributed.DistEmbedding
  
  Parameters
  ----------
  params : list of DistEmbedding
      The list of DistEmbedding.
  lr : float
      The learning rate.
docstr: Load the local state from the input state_dict,
  updating the optimizer as needed.
  
  Parameters
  ----------
  local_state_dict : dict
      Optimizer state; should be an object returned
      from a call to local_state_dict().
  
  See Also
  --------
  local_state_dict
docstr_tok: ["Load","the","local","state","from","the","input","state_dict",",","updating","the","optimizer","as","needed",".","Parameters","--","--","--","--","--","local_state_dict",":","dict","Optimizer","state",";","should","be","an","object","returned","from","a","call","to","local_state_dict","(",")",".","See","Also","--","--","--","--","local_state_dict"]
code: def load_local_state_dict(self, local_state_dict):
      """Load the local state from the input state_dict,
      updating the optimizer as needed.
  
      Parameters
      ----------
      local_state_dict : dict
          Optimizer state; should be an object returned
          from a call to local_state_dict().
  
      See Also
      --------
      local_state_dict
      """
      for emb_name, emb_state in local_state_dict[EMB_STATES].items():
          idx = emb_state[IDS]
          # As state of an embedding of different optimizers can be a single
          # DistTensor(Adagrad) or a tuple(Adam) of that, converting it to list for
          # consistency. The list contains reference(s) to original DistTensor(s).
          states = (
              list(self._state[emb_name])
              if isinstance(self._state[emb_name], tuple)
              else [self._state[emb_name]]
          )
          if len(emb_state[STATES]) != len(states):
              raise ValueError(
                  f"loaded state dict has a different number of states"
                  f" of embedding {emb_name}"
              )
          name_to_index = {
              state.name: index for index, state in enumerate(states)
          }
          for name, state in emb_state[STATES].items():
              if name not in name_to_index:
                  raise ValueError(
                      "loaded state dict contains a state {name}"
                      "that can't be found in the optimizer states"
                  )
              state_idx = name_to_index[name]
              state = state.to(
                  th.device("cpu"), states[name_to_index[name]].dtype
              )
              states[state_idx][idx] = state
      self._defaults.update(local_state_dict[PARAMS])
      self.__dict__.update(local_state_dict[PARAMS])
  
imports: import abc
  import warnings
  from abc import abstractmethod
  from os.path import exists
  import torch
  import dgl
  from ....None import backend
  from ...dist_tensor import DistTensor
  from ...graph_partition_book import EDGE_PART_POLICY, NODE_PART_POLICY
  from ...nn.pytorch import DistEmbedding
  from .utils import alltoall, alltoallv
label_desc: Use image node_id 3 for calling the DistSparseGradOptimizer obj's underlying member method code with example usage: obj.load_local_state_dict(local_state_dict) without return types