class_docstr: Embedding layer for featureless heterograph.
  Parameters
  ----------
  dev_id : int
      Device to run the layer.
  num_nodes : int
      Number of nodes.
  node_tides : tensor
      Storing the node type id for each node starting from 0
  num_of_ntype : int
      Number of node types
  input_size : list of int
      A list of input feature size for each node type. If None, we then
      treat certain input feature as an one-hot encoding feature.
  embed_size : int
      Output embed size
  dgl_sparse : bool, optional
      If true, use dgl.nn.NodeEmbedding otherwise use torch.nn.Embedding
class_docstr_tok: ["Embedding","layer","for","featureless","heterograph",".","Parameters","--","--","--","--","--","dev_id",":","int","Device","to","run","the","layer",".","num_nodes",":","int","Number","of","nodes",".","node_tides",":","tensor","Storing","the","node","type","id","for","each","node","starting","from","0","num_of_ntype",":","int","Number","of","node","types","input_size",":","list","of","int","A","list","of","input","feature","size","for","each","node","type",".","If","None",",","we","then","treat","certain","input","feature","as","an","one-hot","encoding","feature",".","embed_size",":","int","Output","embed","size","dgl_sparse",":","bool",",","optional","If","true",",","use","dgl.nn.NodeEmbedding","otherwise","use","torch.nn.Embedding"]
code: def __init__(
      self,
      dev_id,
      num_nodes,
      node_tids,
      num_of_ntype,
      input_size,
      embed_size,
      dgl_sparse=False,
  ):
      super(RelGraphEmbedLayer, self).__init__()
      self.dev_id = th.device(dev_id if dev_id >= 0 else "cpu")
      self.embed_size = embed_size
      self.num_nodes = num_nodes
      self.dgl_sparse = dgl_sparse
  
      # create weight embeddings for each node for each relation
      self.embeds = nn.ParameterDict()
      self.node_embeds = {} if dgl_sparse else nn.ModuleDict()
      self.num_of_ntype = num_of_ntype
  
      for ntype in range(num_of_ntype):
          if isinstance(input_size[ntype], int):
              if dgl_sparse:
                  self.node_embeds[str(ntype)] = dgl.nn.NodeEmbedding(
                      input_size[ntype],
                      embed_size,
                      name=str(ntype),
                      init_func=initializer,
                  )
              else:
                  sparse_emb = th.nn.Embedding(
                      input_size[ntype], embed_size, sparse=True
                  )
                  nn.init.uniform_(sparse_emb.weight, -1.0, 1.0)
                  self.node_embeds[str(ntype)] = sparse_emb
          else:
              input_emb_size = input_size[ntype].shape[1]
              embed = nn.Parameter(
                  th.Tensor(input_emb_size, self.embed_size)
              )
              nn.init.xavier_uniform_(embed)
              self.embeds[str(ntype)] = embed
  
file_path: dgl/benchmarks/benchmarks/multigpu/rgcn_model.py
imports: import dgl
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new RelGraphEmbedLayer object from inherited base classes: nn with example: obj = RelGraphEmbedLayer(dev_id, num_nodes, node_tids, num_of_ntype, input_size, embed_size, dgl_sparse)