class_docstr: Bridging the Gap Between Anchor-based and Anchor-free Detection
  via Adaptive Training Sample Selection
code: def _gather_topk_pyramid(
      self, gt2anchor_distances, num_anchors_list, pad_gt_mask
  ):
      gt2anchor_distances_list = paddle.split(
          gt2anchor_distances, num_anchors_list, axis=-1
      )
      num_anchors_index = np.cumsum(num_anchors_list).tolist()
      num_anchors_index = [
          0,
      ] + num_anchors_index[:-1]
      is_in_topk_list = []
      topk_idxs_list = []
      for distances, anchors_index in zip(
          gt2anchor_distances_list, num_anchors_index
      ):
          num_anchors = distances.shape[-1]
          _, topk_idxs = paddle.topk(
              distances, self.topk, axis=-1, largest=False
          )
          topk_idxs_list.append(topk_idxs + anchors_index)
          is_in_topk = (
              F.one_hot(topk_idxs, num_anchors)
              .sum(axis=-2)
              .astype(gt2anchor_distances.dtype)
          )
          is_in_topk_list.append(is_in_topk * pad_gt_mask)
      is_in_topk_list = paddle.concat(is_in_topk_list, axis=-1)
      topk_idxs_list = paddle.concat(topk_idxs_list, axis=-1)
      return is_in_topk_list, topk_idxs_list
  
file_path: PaddleDetection/ppdet/modeling/assigners/atss_assigner.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..bbox_utils import iou_similarity, batch_iou_similarity
  from ..bbox_utils import bbox_center
  from .utils import check_points_inside_bboxes, compute_max_iou_anchor, compute_max_iou_gt
label_desc: Use image node_id 2 for calling the ATSSAssigner obj's underlying member method code with example usage: obj._gather_topk_pyramid(gt2anchor_distances, num_anchors_list, pad_gt_mask) and returns: is_in_topk_list,  topk_idxs_list