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"]
docstr: Forward computation
  Parameters
  ----------
  node_ids : tensor
      node ids to generate embedding for.
  node_ids : tensor
      node type ids
  features : list of features
      list of initial features for nodes belong to different node type.
      If None, the corresponding features is an one-hot encoding feature,
      else use the features directly as input feature and matmul a
      projection matrix.
  Returns
  -------
  tensor
      embeddings as the input of the next layer
docstr_tok: ["Forward","computation","Parameters","--","--","--","--","--","node_ids",":","tensor","node","ids","to","generate","embedding","for",".","node_ids",":","tensor","node","type","ids","features",":","list","of","features","list","of","initial","features","for","nodes","belong","to","different","node","type",".","If","None",",","the","corresponding","features","is","an","one-hot","encoding","feature",",","else","use","the","features","directly","as","input","feature","and","matmul","a","projection","matrix",".","Returns","--","--","--","-","tensor","embeddings","as","the","input","of","the","next","layer"]
code: def forward(self, node_ids, node_tids, type_ids, features):
      """Forward computation
      Parameters
      ----------
      node_ids : tensor
          node ids to generate embedding for.
      node_ids : tensor
          node type ids
      features : list of features
          list of initial features for nodes belong to different node type.
          If None, the corresponding features is an one-hot encoding feature,
          else use the features directly as input feature and matmul a
          projection matrix.
      Returns
      -------
      tensor
          embeddings as the input of the next layer
      """
      tsd_ids = node_ids.to(self.dev_id)
      embeds = th.empty(
          node_ids.shape[0], self.embed_size, device=self.dev_id
      )
      for ntype in range(self.num_of_ntype):
          loc = node_tids == ntype
          if isinstance(features[ntype], int):
              if self.dgl_sparse:
                  embeds[loc] = self.node_embeds[str(ntype)](
                      type_ids[loc], self.dev_id
                  )
              else:
                  embeds[loc] = self.node_embeds[str(ntype)](
                      type_ids[loc]
                  ).to(self.dev_id)
          else:
              embeds[loc] = features[ntype][type_ids[loc]].to(
                  self.dev_id
              ) @ self.embeds[str(ntype)].to(self.dev_id)
  
      return embeds
  
file_path: dgl/benchmarks/benchmarks/multigpu/rgcn_model.py
imports: import dgl
  import torch
  import torch.nn
label_desc: Use image node_id 3 for calling the RelGraphEmbedLayer obj's underlying member method code with example usage: obj.forward(node_ids, node_tids, type_ids, features) and returns: embeds