code: def flatten_tensor(tensor, scope):
      assert tensor.size(0) == len(scope)
      tlist = []
      for i, tup in enumerate(scope):
          le = tup[1]
          tlist.append(tensor[i, 0:le])
      return torch.cat(tlist, dim=0)
  
file_path: DIG/dig/ggraph/method/JTVAE/fast_jtnn/nnutils.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
label_desc: Use image node_id 5 for calling a global function with example usage: flatten_tensor(tensor, scope) and returns: torch