class_docstr: Relational graph convolution layer.
  
  Parameters
  ----------
  in_feat : int
      Input feature size.
  out_feat : int
      Output feature size.
  rel_names : list[str]
      Relation names.
  num_bases : int, optional
      Number of bases. If is none, use number of relations. Default: None.
  weight : bool, optional
      True if a linear layer is applied after message passing. Default: True
  bias : bool, optional
      True if bias is added. Default: True
  activation : callable, optional
      Activation function. Default: None
  self_loop : bool, optional
      True to include self loop message. Default: False
  dropout : float, optional
      Dropout rate. Default: 0.0
class_docstr_tok: ["Relational","graph","convolution","layer",".","Parameters","--","--","--","--","--","in_feat",":","int","Input","feature","size",".","out_feat",":","int","Output","feature","size",".","rel_names",":","list","[","str","]","Relation","names",".","num_bases",":","int",",","optional","Number","of","bases",".","If","is","none",",","use","number","of","relations",".","Default",":","None",".","weight",":","bool",",","optional","True","if","a","linear","layer","is","applied","after","message","passing",".","Default",":","True","bias",":","bool",",","optional","True","if","bias","is","added",".","Default",":","True","activation",":","callable",",","optional","Activation","function",".","Default",":","None","self_loop",":","bool",",","optional","True","to","include","self","loop","message",".","Default",":","False","dropout",":","float",",","optional","Dropout","rate",".","Default",":","0.0"]
docstr: Forward computation
  
  Parameters
  ----------
  g : DGLGraph
      Input graph.
  inputs : dict[str, torch.Tensor]
      Node feature for each node type.
  
  Returns
  -------
  dict[str, torch.Tensor]
      New node features for each node type.
docstr_tok: ["Forward","computation","Parameters","--","--","--","--","--","g",":","DGLGraph","Input","graph",".","inputs",":","dict","[","str",",","torch.Tensor","]","Node","feature","for","each","node","type",".","Returns","--","--","--","-","dict","[","str",",","torch.Tensor","]","New","node","features","for","each","node","type","."]
code: def forward(self, g, inputs):
      """Forward computation
  
      Parameters
      ----------
      g : DGLGraph
          Input graph.
      inputs : dict[str, torch.Tensor]
          Node feature for each node type.
  
      Returns
      -------
      dict[str, torch.Tensor]
          New node features for each node type.
      """
      g = g.local_var()
      if self.use_weight:
          weight = self.basis() if self.use_basis else self.weight
          wdict = {
              self.rel_names[i]: {"weight": w.squeeze(0)}
              for i, w in enumerate(th.split(weight, 1, dim=0))
          }
      else:
          wdict = {}
  
      inputs_src = inputs_dst = inputs
  
      for srctype, _, _ in g.canonical_etypes:
          g.nodes[srctype].data["h"] = inputs[srctype]
  
      if self.use_weight:
          g.apply_edges(fn.copy_u("h", "m"))
          m = g.edata["m"]
          for rel in g.canonical_etypes:
              _, etype, _ = rel
              g.edges[rel].data["h*w_r"] = th.matmul(
                  m[rel], wdict[etype]["weight"]
              )
      else:
          g.apply_edges(fn.copy_u("h", "h*w_r"))
  
      g.update_all(fn.copy_e("h*w_r", "m"), fn.sum("m", "h"))
  
      def _apply(ntype):
          h = g.nodes[ntype].data["h"]
          if self.self_loop:
              h = h + th.matmul(inputs_dst[ntype], self.loop_weight)
          if self.bias:
              h = h + self.h_bias
          if self.activation:
              h = self.activation(h)
          return self.dropout(h)
  
      return {ntype: _apply(ntype) for ntype in g.dsttypes}
  
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 2 for calling the RelGraphConvLayerHeteroAPI obj's underlying member method code with example usage: obj.forward(g, inputs) and returns: unknown, self