docstr: Args:
      x: current node feature matrix with shape (batch, N, 9)
      adj: current adjacency feature matrix with shape (batch, 4, N, N)
      index: link prediction index with shape (batch, 2)
  Returns:
      Embedding(concatenate graph embedding, edge start node embedding and edge end node embedding) 
          for updating edge features with shape (batch, 3d)
docstr_tok: ["Args",":","x",":","current","node","feature","matrix","with","shape","(","batch",",","N",",","9",")","adj",":","current","adjacency","feature","matrix","with","shape","(","batch",",","4",",","N",",","N",")","index",":","link","prediction","index","with","shape","(","batch",",","2",")","Returns",":","Embedding","(","concatenate","graph","embedding",",","edge","start","node","embedding","and","edge","end","node","embedding",")","for","updating","edge","features","with","shape","(","batch",",","3d",")"]
code: def _get_embs_edge(self, x, adj, index):
      """
      Args:
          x: current node feature matrix with shape (batch, N, 9)
          adj: current adjacency feature matrix with shape (batch, 4, N, N)
          index: link prediction index with shape (batch, 2)
      Returns:
          Embedding(concatenate graph embedding, edge start node embedding and edge end node embedding)
              for updating edge features with shape (batch, 3d)
      """
      batch_size = x.size(0)
      assert batch_size == index.size(0)
  
      adj = adj[:, :3]  # (batch, 3, N, N)
  
      node_emb = self.rgcn(x, adj)  # (batch, N, d)
      if hasattr(self, "batchNorm"):
          node_emb = self.batchNorm(node_emb.transpose(1, 2)).transpose(
              1, 2
          )  # (batch, N, d)
  
      graph_emb = (
          torch.sum(node_emb, dim=1, keepdim=False)
          .contiguous()
          .view(batch_size, 1, -1)
      )  # (batch, 1, d)
  
      index = index.view(batch_size, -1, 1).repeat(
          1, 1, self.emb_size
      )  # (batch, 2, d)
      graph_node_emb = torch.cat(
          (torch.gather(node_emb, dim=1, index=index), graph_emb), dim=1
      )  # (batch_size, 3, d)
      graph_node_emb = graph_node_emb.view(
          batch_size, -1
      )  # (batch_size, 3d)
      return graph_node_emb
  
file_path: DIG/dig/ggraph/method/GraphAF/model/graphaf.py
imports: import numpy
  import torch
  import torch.nn
  from .rgcn import *
  from .st_net import *
label_desc: Use image node_id 7 for calling the MaskedGraphAF obj's underlying member method code with example usage: obj._get_embs_edge(x, adj, index) and returns: graph_node_emb