class_docstr: Implementation of single layer of interaction network
  Parameters
  ==========
  in_node_feats : int
      Number of node features
  
  in_edge_feats : int
      Number of edge features
  
  out_node_feats : int
      Number of node feature after one interaction
  
  out_edge_feats : int
      Number of edge features after one interaction
  
  global_feats : int
      Number of global features used as input
  
  relate_feats : int
      Feature related to the relation between object themselves
  
  edge_fn : torch.nn.Module
      Function to update edge feature in message generation
  
  node_fn : torch.nn.Module
      Function to update node feature in message aggregation
  
  mode : str
      Type of message should the edge carry
      nne : [src_feat,dst_feat,edge_feat] node feature concat edge feature.
      n_n : [src_feat-edge_feat] node feature subtract from each other.
class_docstr_tok: ["Implementation","of","single","layer","of","interaction","network","Parameters","==========","in_node_feats",":","int","Number","of","node","features","in_edge_feats",":","int","Number","of","edge","features","out_node_feats",":","int","Number","of","node","feature","after","one","interaction","out_edge_feats",":","int","Number","of","edge","features","after","one","interaction","global_feats",":","int","Number","of","global","features","used","as","input","relate_feats",":","int","Feature","related","to","the","relation","between","object","themselves","edge_fn",":","torch.nn.Module","Function","to","update","edge","feature","in","message","generation","node_fn",":","torch.nn.Module","Function","to","update","node","feature","in","message","aggregation","mode",":","str","Type","of","message","should","the","edge","carry","nne",":","[","src_feat",",","dst_feat",",","edge_feat","]","node","feature","concat","edge","feature",".","n_n",":","[","src_feat-edge_feat","]","node","feature","subtract","from","each","other","."]
code: def update_edge_fn(self, edges):
      x = torch.cat(
          [edges.src["feat"], edges.dst["feat"], edges.data["feat"]],
          dim=1,
      )
      ret = (
          F.relu(self.edge_fn(x))
          if self.mode == "nne"
          else self.edge_fn(x)
      )
      return {"e": ret}
  
imports: import copy
  from functools import partial
  import dgl
  import dgl.function
  import dgl.nn
  import torch
  import torch.nn
  from torch.nn import functional
label_desc: Use image node_id 2 for calling the InteractionLayer obj's underlying member method code with example usage: obj.update_edge_fn(edges) and returns: dict