code: def gather_feat(feat, ind, mask=None):
      """Gather feature according to index.
  
      Args:
          feat (Tensor): Target feature map.
          ind (Tensor): Target coord index.
          mask (Tensor | None): Mask of feature map. Default: None.
  
      Returns:
          feat (Tensor): Gathered feature.
      """
      dim = feat.size(2)
      ind = ind.unsqueeze(2).repeat(1, 1, dim)
      feat = feat.gather(1, ind)
      if mask is not None:
          mask = mask.unsqueeze(2).expand_as(feat)
          feat = feat[mask]
          feat = feat.view(-1, dim)
      return feat
  
file_path: mmdetection/mmdet/models/utils/gaussian_target.py
imports: from math import sqrt
  import torch
  import torch.nn.functional
label_desc: Use image node_id 6 for calling a global function with example usage: gather_feat(feat, ind, mask) and returns: feat