class_docstr: Embedding layer for featureless heterograph.
class_docstr_tok: ["Embedding","layer","for","featureless","heterograph","."]
code: def __init__(
      self,
      g,
      embed_size,
      embed_name="embed",
      activation=None,
      dropout=0.0,
  ):
      super(RelGraphEmbed, self).__init__()
      self.g = g
      self.embed_size = embed_size
      self.embed_name = embed_name
      self.activation = activation
      self.dropout = nn.Dropout(dropout)
  
      # create weight embeddings for each node for each relation
      self.embeds = nn.ParameterDict()
      for ntype in g.ntypes:
          embed = nn.Parameter(
              th.Tensor(g.num_nodes(ntype), self.embed_size)
          )
          nn.init.xavier_uniform_(
              embed, gain=nn.init.calculate_gain("relu")
          )
          self.embeds[ntype] = embed
  
imports: from collections import defaultdict
  import dgl
  import dgl.function
  import dgl.nn
  import torch
  import torch.nn
  import torch.nn.functional
  import tqdm
label_desc: Use image node_id 1 to create a new RelGraphEmbed object from inherited base classes: nn with example: obj = RelGraphEmbed(g, embed_size, embed_name, activation, dropout)