class_docstr: SharedEmbedding in mmap mode.
  
  Args:
      num_embeddings (int):
          The number of embeddings.
      embedding_dim (int):
          The dimension of embeddings.
      high (float):
          Optional. The upper bound of embedding values.
      low (float):
          Optional. The lower bound of embedding values.
      weight (np.ndarray):
          Optional. The array used to initialize embeddings.
      weight_path (str):
          The file to save and load embeddings.
      optimizer (str):
          The optimizer used to update embeddings during training. Choices: sgd, adagrad.
      learning_rate (float):
          The learning rate of optimizer.
      init_mode (str):
          The source of embeddings initialization. Choices: range, array, file.
      num_workers (int):
          The number of processes to update gradients.
class_docstr_tok: ["SharedEmbedding","in","mmap","mode",".","Args",":","num_embeddings","(","int",")",":","The","number","of","embeddings",".","embedding_dim","(","int",")",":","The","dimension","of","embeddings",".","high","(","float",")",":","Optional",".","The","upper","bound","of","embedding","values",".","low","(","float",")",":","Optional",".","The","lower","bound","of","embedding","values",".","weight","(","np.ndarray",")",":","Optional",".","The","array","used","to","initialize","embeddings",".","weight_path","(","str",")",":","The","file","to","save","and","load","embeddings",".","optimizer","(","str",")",":","The","optimizer","used","to","update","embeddings","during","training",".","Choices",":","sgd",",","adagrad",".","learning_rate","(","float",")",":","The","learning","rate","of","optimizer",".","init_mode","(","str",")",":","The","source","of","embeddings","initialization",".","Choices",":","range",",","array",",","file",".","num_workers","(","int",")",":","The","number","of","processes","to","update","gradients","."]
code: def __init__(
      self,
      num_embeddings=1,
      embedding_dim=1,
      high=1,
      low=None,
      weight=None,
      weight_path="./__default_shared_embedding.npy",
      optimizer="adagrad",
      learning_rate=0.1,
      init_mode="range",
      num_workers=1,
  ):
      super(SharedEmbedding, self).__init__()
      self._num_embed = num_embeddings
      self._embed_dim = embedding_dim
      self._init_mode = init_mode
      self._low = low
      self._high = high
      self._weight_path = weight_path
      self._moment_path = os.path.join(
          os.path.dirname(self._weight_path),
          os.path.basename(self._weight_path).strip(".npy")
          + "_moment.npy",
      )
      self._init_weight(weight)
  
      self.trace = []
      self._stop_gradient = False
  
      self._optim_mode = optimizer.lower()
      self._lr = learning_rate
      self._update = self._set_optimizer()
  
      self._process_worker = num_workers
      self._async_q = None
      self._async_e = None
      self._async_p = []
      for i in range(self._process_worker):
          self._async_p.append(None)
  
imports: import os
  import time
  import numpy
  import paddle
  import paddle.distributed
label_desc: Use image node_id 1 to create a new SharedEmbedding object from inherited base classes: object with example: obj = SharedEmbedding(num_embeddings, embedding_dim, high, low, weight, weight_path, optimizer, learning_rate, init_mode, num_workers)