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 the valid flags of points of a single feature map.
  
  Args:
      featmap_size (tuple[int]): The size of feature maps, arrange as
          as (h, w).
      valid_size (tuple[int]): The valid size of the feature maps.
          The size arrange as as (h, w).
      device (str, optional): The device where the flags will be put on.
          Defaults to 'cuda'.
  
  Returns:
      torch.Tensor: The valid flags of each points in a single level                 feature map.
docstr_tok: ["Generate","the","valid","flags","of","points","of","a","single","feature","map",".","Args",":","featmap_size","(","tuple","[","int","]",")",":","The","size","of","feature","maps",",","arrange","as","as","(","h",",","w",")",".","valid_size","(","tuple","[","int","]",")",":","The","valid","size","of","the","feature","maps",".","The","size","arrange","as","as","(","h",",","w",")",".","device","(","str",",","optional",")",":","The","device","where","the","flags","will","be","put","on",".","Defaults","to","'cuda","'",".","Returns",":","torch.Tensor",":","The","valid","flags","of","each","points","in","a","single","level","feature","map","."]
code: def single_level_valid_flags(
      self, featmap_size, valid_size, device="cuda"
  ):
      """Generate the valid flags of points of a single feature map.
  
          Args:
              featmap_size (tuple[int]): The size of feature maps, arrange as
                  as (h, w).
              valid_size (tuple[int]): The valid size of the feature maps.
                  The size arrange as as (h, w).
              device (str, optional): The device where the flags will be put on.
                  Defaults to 'cuda'.
  
          Returns:
              torch.Tensor: The valid flags of each points in a single level \
                  feature map.
          """
      feat_h, feat_w = featmap_size
      valid_h, valid_w = valid_size
      assert valid_h <= feat_h and valid_w <= feat_w
      valid_x = torch.zeros(feat_w, dtype=torch.bool, device=device)
      valid_y = torch.zeros(feat_h, dtype=torch.bool, device=device)
      valid_x[:valid_w] = 1
      valid_y[:valid_h] = 1
      valid_xx, valid_yy = self._meshgrid(valid_x, valid_y)
      valid = valid_xx & valid_yy
      return valid
  
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 8 for calling the MlvlPointGenerator obj's underlying member method code with example usage: obj.single_level_valid_flags(featmap_size, valid_size, device) and returns: valid