class_docstr: The abstract sparse optimizer.
  
  Note: dgl sparse optimizer only work with dgl.NodeEmbedding
  
  Parameters
  ----------
  params : list of NodeEmbedding
      The list of NodeEmbeddings.
  lr : float
      The learning rate.
docstr: Return a copy of the whole optimizer states stored in CPU memory.
  If this is a multi-processing instance, the states will be returned in
  shared memory. If the underlying embedding is currently stored on
  multiple GPUs, all processes must call this method in the same order.
  
  NOTE: This method must be called by all processes sharing the
  underlying embedding, or it may result in a deadlock.
  
  Returns
  -------
  dictionary of optimizer states
      The optimizer states stored in CPU memory.
docstr_tok: ["Return","a","copy","of","the","whole","optimizer","states","stored","in","CPU","memory",".","If","this","is","a","multi-processing","instance",",","the","states","will","be","returned","in","shared","memory",".","If","the","underlying","embedding","is","currently","stored","on","multiple","GPUs",",","all","processes","must","call","this","method","in","the","same","order",".","NOTE",":","This","method","must","be","called","by","all","processes","sharing","the","underlying","embedding",",","or","it","may","result","in","a","deadlock",".","Returns","--","--","--","-","dictionary","of","optimizer","states","The","optimizer","states","stored","in","CPU","memory","."]
code: def state_dict(self, **kwargs):  # pylint: disable=unused-argument
      """Return a copy of the whole optimizer states stored in CPU memory.
      If this is a multi-processing instance, the states will be returned in
      shared memory. If the underlying embedding is currently stored on
      multiple GPUs, all processes must call this method in the same order.
  
      NOTE: This method must be called by all processes sharing the
      underlying embedding, or it may result in a deadlock.
  
      Returns
      -------
      dictionary of optimizer states
          The optimizer states stored in CPU memory.
      """
      return {
          "state": {
              emb.name: emb._all_get_optm_state()
              for emb in self._params
          },
          "param_groups": self.param_groups,
      }
  
imports: import abc
  from abc import abstractmethod
  import torch
  from ...cuda import nccl
  from ...nn.pytorch import NodeEmbedding
  from ...partition import NDArrayPartition
  from ...utils import create_shared_mem_array, gather_pinned_tensor_rows, get_shared_mem_array, pin_memory_inplace, scatter_pinned_tensor_rows
label_desc: Use image node_id 10 for calling the SparseGradOptimizer obj's underlying member method code with example usage: obj.state_dict() and returns: dict