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: Update embeddings in a sparse manner
  Sparse embeddings are updated in mini batches. We maintain gradient states for
  each embedding so they can be updated separately.
  
  Parameters
  ----------
  idx : tensor
      Index of the embeddings to be updated.
  grad : tensor
      Gradient of each embedding.
  emb : dgl.nn.NodeEmbedding
      Sparse node embedding to update.
docstr_tok: ["Update","embeddings","in","a","sparse","manner","Sparse","embeddings","are","updated","in","mini","batches",".","We","maintain","gradient","states","for","each","embedding","so","they","can","be","updated","separately",".","Parameters","--","--","--","--","--","idx",":","tensor","Index","of","the","embeddings","to","be","updated",".","grad",":","tensor","Gradient","of","each","embedding",".","emb",":","dgl.nn.NodeEmbedding","Sparse","node","embedding","to","update","."]
code: def update(self, idx, grad, emb):
      """Update embeddings in a sparse manner
      Sparse embeddings are updated in mini batches. We maintain gradient states for
      each embedding so they can be updated separately.
  
      Parameters
      ----------
      idx : tensor
          Index of the embeddings to be updated.
      grad : tensor
          Gradient of each embedding.
      emb : dgl.nn.NodeEmbedding
          Sparse node embedding to update.
      """
  
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 8 for calling the SparseGradOptimizer obj's underlying member method code with example usage: obj.update(idx, grad, emb) without return types