code: def avg_pool(all_vecs, scope, dim):
      size = create_var(torch.Tensor([le for _, le in scope]))
      return all_vecs.sum(dim=dim) / size.unsqueeze(-1)
  
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 3 for calling a global function with example usage: avg_pool(all_vecs, scope, dim) and returns: unknown