class_docstr: Standard points generator for multi-level (Mlvl) feature maps in 2D
  points-based detectors.
  
  Args:
      strides (list[int] | list[tuple[int, int]]): Strides of anchors
          in multiple feature levels in order (w, h).
      offset (float): The offset of points, the value is normalized with
          corresponding stride. Defaults to 0.5.
docstr: Generate sparse points according to the ``prior_idxs``.
  
  Args:
      prior_idxs (Tensor): The index of corresponding anchors
          in the feature map.
      featmap_size (tuple[int]): feature map size arrange as (w, h).
      level_idx (int): The level index of corresponding feature
          map.
      dtype (obj:`torch.dtype`): Date type of points. Defaults to
          ``torch.float32``.
      device (obj:`torch.device`): The device where the points is
          located.
  Returns:
      Tensor: Anchor with shape (N, 2), N should be equal to
      the length of ``prior_idxs``. And last dimension
      2 represent (coord_x, coord_y).
docstr_tok: ["Generate","sparse","points","according","to","the","``","prior_idxs","``",".","Args",":","prior_idxs","(","Tensor",")",":","The","index","of","corresponding","anchors","in","the","feature","map",".","featmap_size","(","tuple","[","int","]",")",":","feature","map","size","arrange","as","(","w",",","h",")",".","level_idx","(","int",")",":","The","level","index","of","corresponding","feature","map",".","dtype","(","obj",":","`","torch.dtype","`",")",":","Date","type","of","points",".","Defaults","to","``","torch.float32","``",".","device","(","obj",":","`","torch.device","`",")",":","The","device","where","the","points","is","located",".","Returns",":","Tensor",":","Anchor","with","shape","(","N",",","2",")",",","N","should","be","equal","to","the","length","of","``","prior_idxs","``",".","And","last","dimension","2","represent","(","coord_x",",","coord_y",")","."]
code: def sparse_priors(
      self,
      prior_idxs,
      featmap_size,
      level_idx,
      dtype=torch.float32,
      device="cuda",
  ):
      """Generate sparse points according to the ``prior_idxs``.
  
      Args:
          prior_idxs (Tensor): The index of corresponding anchors
              in the feature map.
          featmap_size (tuple[int]): feature map size arrange as (w, h).
          level_idx (int): The level index of corresponding feature
              map.
          dtype (obj:`torch.dtype`): Date type of points. Defaults to
              ``torch.float32``.
          device (obj:`torch.device`): The device where the points is
              located.
      Returns:
          Tensor: Anchor with shape (N, 2), N should be equal to
          the length of ``prior_idxs``. And last dimension
          2 represent (coord_x, coord_y).
      """
      height, width = featmap_size
      x = (prior_idxs % width + self.offset) * self.strides[level_idx][
          0
      ]
      y = ((prior_idxs // width) % height + self.offset) * self.strides[
          level_idx
      ][1]
      prioris = torch.stack([x, y], 1).to(dtype)
      prioris = prioris.to(device)
      return prioris
  
file_path: dinov2/dinov2/eval/segmentation_m2f/core/anchor/point_generator.py
imports: import numpy
  import torch
  from torch.nn.modules.utils import _pair
  from .builder import PRIOR_GENERATORS
label_desc: Use image node_id 9 for calling the MlvlPointGenerator obj's underlying member method code with example usage: obj.sparse_priors(prior_idxs, featmap_size, level_idx, dtype, device) and returns: prioris