class_docstr: Relation GCN layer. 
class_docstr_tok: ["Relation","GCN","layer","."]
docstr: :param x: (batch, N, d)
  :param adj: (batch, E, N, N)
  typically d=9 e=3
  :return:
  updated x with shape (batch, N, d)
docstr_tok: [":","param","x",":","(","batch",",","N",",","d",")",":","param","adj",":","(","batch",",","E",",","N",",","N",")","typically","d=9","e=3",":","return",":","updated","x","with","shape","(","batch",",","N",",","d",")"]
code: def forward(self, x, adj):
      """
      :param x: (batch, N, d)
      :param adj: (batch, E, N, N)
      typically d=9 e=3
      :return:
      updated x with shape (batch, N, d)
      """
      x = F.dropout(
          x, p=self.dropout, training=self.training
      )  # (b, N, d)
  
      batch_size = x.size(0)
  
      # transform
      support = torch.einsum("bid, edh-> beih", x, self.weight)
      output = torch.einsum(
          "beij, bejh-> beih", adj, support
      )  # (batch, e, N, d)
  
      if self.bias is not None:
          output += self.bias
      if self.act is not None:
          output = self.act(output)  # (b, E, N, d)
      output = output.view(
          batch_size, self.edge_dim, x.size(1), self.out_features
      )  # (b, E, N, d)
  
      if self.aggregate == "sum":
          # sum pooling #(b, N, d)
          node_embedding = torch.sum(output, dim=1, keepdim=False)
      elif self.aggregate == "max":
          # max pooling  #(b, N, d)
          node_embedding = torch.max(output, dim=1, keepdim=False)
      elif self.aggregate == "mean":
          # mean pooling #(b, N, d)
          node_embedding = torch.mean(output, dim=1, keepdim=False)
      elif self.aggregate == "concat":
          #! implementation wrong
          node_embedding = torch.cat(
              torch.split(output, dim=1, split_size_or_sections=1),
              dim=3,
          )  # (b, 1, n, d*e)
          node_embedding = torch.squeeze(
              node_embedding, dim=1
          )  # (b, n, d*e)
      else:
          print("GCN aggregate error!")
      return node_embedding
  
file_path: DIG/dig/ggraph/method/GraphDF/model/rgcn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 3 for calling the RelationGraphConvolution obj's underlying member method code with example usage: obj.forward(x, adj) and returns: node_embedding