class_docstr: Sparse Embedding for Knowledge Graph
  It is used to store both entity embeddings and relation embeddings.
  
  Parameters
  ----------
  args :
      Global configs.
  num : int
      Number of embeddings.
  dim : int
      Embedding dimention size.
  device : th.device
      Device to store the embedding.
code: def __init__(self, args, num, dim, device, is_feat=False):
      self.gpu = args.gpu
      self.args = args
      self.num = num
      self.trace = []
      self.is_feat = is_feat
      if not is_feat:
          self.emb = th.empty(num, dim, dtype=th.float32, device=device)
          self.state_sum = (
              self.emb.new().resize_(self.emb.size(0)).zero_()
          )
      else:
          self.emb = None
          self.state_sum = None
      self.state_step = 0
      self.has_cross_rel = False
      # queue used by asynchronous update
      self.async_q = None
      # asynchronous update process
      self.async_p = None
  
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.nn.init
  import torch.multiprocessing
  from torch.multiprocessing import Queue
  from _thread import start_new_thread
  import traceback
  from functools import wraps
  from ..None import *
label_desc: Use image node_id 1 to create a new ExternalEmbedding object  with example: obj = ExternalEmbedding(args, num, dim, device, is_feat)