code: def _get_point_coords_by_uncertainty(self, masks):
      # Sample points based on their uncertainty.
      masks = masks.detach()
      num_masks = masks.shape[0]
      sample_points = paddle.rand(
          [num_masks, 1, self.num_oversample_points, 2]
      )
  
      out_mask = F.grid_sample(
          masks.unsqueeze(1),
          2.0 * sample_points - 1.0,
          align_corners=False,
      ).squeeze([1, 2])
      out_mask = -paddle.abs(out_mask)
  
      _, topk_ind = paddle.topk(
          out_mask, self.num_important_points, axis=1
      )
      batch_ind = paddle.arange(end=num_masks, dtype=topk_ind.dtype)
      batch_ind = batch_ind.unsqueeze(-1).tile(
          [1, self.num_important_points]
      )
      topk_ind = paddle.stack([batch_ind, topk_ind], axis=-1)
  
      sample_points = paddle.gather_nd(
          sample_points.squeeze(1), topk_ind
      )
      if self.num_random_points > 0:
          sample_points = paddle.concat(
              [
                  sample_points,
                  paddle.rand([num_masks, self.num_random_points, 2]),
              ],
              axis=1,
          )
      return sample_points
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from .iou_loss import GIoULoss
  from ..transformers import bbox_cxcywh_to_xyxy, sigmoid_focal_loss, varifocal_loss_with_logits
  from ..bbox_utils import bbox_iou
label_desc: Use image node_id 4 for calling the MaskDINOLoss obj's underlying member method code with example usage: obj._get_point_coords_by_uncertainty(masks) and returns: sample_points