class_docstr: The internal module of a supervertex, which is an external feature layer.
  
  Args:
      in_channels (int): Size of each input sample. In GripNet, it should be the dimension of the output embedding of
      the corresponding parent supervertex.
      out_channels (int): Size of each output sample. In GripNet, it is the dimension of the output embedding of
          the supervertex.
      num_out_node (int): the number of output nodes.
class_docstr_tok: ["The","internal","module","of","a","supervertex",",","which","is","an","external","feature","layer",".","Args",":","in_channels","(","int",")",":","Size","of","each","input","sample",".","In","GripNet",",","it","should","be","the","dimension","of","the","output","embedding","of","the","corresponding","parent","supervertex",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","In","GripNet",",","it","is","the","dimension","of","the","output","embedding","of","the","supervertex",".","num_out_node","(","int",")",":","the","number","of","output","nodes","."]
docstr: Args:
      x (torch.Tensor): the input node feature embedding.
      edge_index (torch.Tensor): edge index in COO format with shape [2, #edges].
      edge_weight (torch.Tensor, optional): one-dimensional weight for each edge. Defaults to None.
      use_relu (bool, optional): whether to use ReLU before returning node feature embeddings. Defaults to True.
docstr_tok: ["Args",":","x","(","torch.Tensor",")",":","the","input","node","feature","embedding",".","edge_index","(","torch.Tensor",")",":","edge","index","in","COO","format","with","shape","[","2",",","#","edges","]",".","edge_weight","(","torch.Tensor",",","optional",")",":","one-dimensional","weight","for","each","edge",".","Defaults","to","None",".","use_relu","(","bool",",","optional",")",":","whether","to","use","ReLU","before","returning","node","feature","embeddings",".","Defaults","to","True","."]
code: def forward(
      self,
      x: torch.Tensor,
      edge_index: torch.Tensor,
      edge_weight: torch.Tensor = None,
      use_relu=True,
  ):
      """
      Args:
          x (torch.Tensor): the input node feature embedding.
          edge_index (torch.Tensor): edge index in COO format with shape [2, #edges].
          edge_weight (torch.Tensor, optional): one-dimensional weight for each edge. Defaults to None.
          use_relu (bool, optional): whether to use ReLU before returning node feature embeddings. Defaults to True.
      """
  
      n_source, n_feat = x.shape
      bigraph_edge_index = edge_index + 0
      bigraph_edge_index[1, :] += n_source
  
      x = torch.cat(
          [x, torch.zeros((self.num_out_node, n_feat)).to(x.device)],
          dim=0,
      )
      x = self.exter_agg_layer(x, bigraph_edge_index, edge_weight)[
          n_source:, :
      ]
  
      if use_relu:
          x = F.relu(x, inplace=True)
  
      return x
  
imports: import logging
  from typing import Dict
  import torch
  import torch.nn.functional
  from torch.nn import Module
  from kale.embed.gcn import GCNEncoderLayer, RGCNEncoderLayer
  from kale.prepdata.supergraph_construct import SuperGraph, SuperVertex, SuperVertexParaSetting
label_desc: Use image node_id 2 for calling the GripNetExternalModule obj's underlying member method code with example usage: obj.forward(x, edge_index, edge_weight, use_relu) and returns: x