code: def forward(self, fnode, fmess, node_graph, mess_graph, scope):
      fnode = create_var(fnode)
      fmess = create_var(fmess)
      node_graph = create_var(node_graph)
      mess_graph = create_var(mess_graph)
      messages = create_var(
          torch.zeros(mess_graph.size(0), self.hidden_size)
      )
  
      fnode = self.embedding(fnode)
      fmess = index_select_ND(fnode, 0, fmess)
      messages = self.GRU(messages, fmess, mess_graph)
  
      mess_nei = index_select_ND(messages, 0, node_graph)
      node_vecs = torch.cat([fnode, mess_nei.sum(dim=1)], dim=-1)
      node_vecs = self.outputNN(node_vecs)
  
      max_len = max([x for _, x in scope])
      batch_vecs = []
      for st, le in scope:
          cur_vecs = node_vecs[st]  # Root is the first node
          batch_vecs.append(cur_vecs)
  
      tree_vecs = torch.stack(batch_vecs, dim=0)
      return tree_vecs, messages
  
file_path: DIG/dig/ggraph/method/JTVAE/fast_jtnn/jtnn_enc.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from .mol_tree import Vocab, MolTree
  from .nnutils import create_var, index_select_ND
label_desc: Use image node_id 2 for calling the JTNNEncoder obj's underlying member method code with example usage: obj.forward(fnode, fmess, node_graph, mess_graph, scope) and returns: tree_vecs,  messages