code: def index_select_ND(source, dim, index):
      index_size = index.size()
      suffix_dim = source.size()[1:]
      final_size = index_size + suffix_dim
      target = source.index_select(dim, index.view(-1))
      return target.view(final_size)
  
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 2 for calling a global function with example usage: index_select_ND(source, dim, index) and returns: target