code: def tensorize(tree_batch):
      node_batch = []
      scope = []
      for tree in tree_batch:
          scope.append((len(node_batch), len(tree.nodes)))
          node_batch.extend(tree.nodes)
  
      return JTNNEncoder.tensorize_nodes(node_batch, scope)
  
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 3 for calling the JTNNEncoder obj's underlying member method code with example usage: obj.tensorize(tree_batch) and returns: JTNNEncoder