docstr: Generate grid points of a single level.
  
  Args:
      featmap_size (tuple[int, int]): Size of the feature maps.
      stride (int): The stride of corresponding feature map.
      device (str | torch.device): The device the tensor will be put on.
          Defaults to 'cuda'.
  
  Returns:
      torch.Tensor: grid point in a feature map.
docstr_tok: ["Generate","grid","points","of","a","single","level",".","Args",":","featmap_size","(","tuple","[","int",",","int","]",")",":","Size","of","the","feature","maps",".","stride","(","int",")",":","The","stride","of","corresponding","feature","map",".","device","(","str","|","torch.device",")",":","The","device","the","tensor","will","be","put","on",".","Defaults","to","'cuda","'",".","Returns",":","torch.Tensor",":","grid","point","in","a","feature","map","."]
code: def grid_points(
      self,
      featmap_size: Tuple[int, int],
      stride=16,
      device: DeviceType = "cuda",
  ) -> Tensor:
      """Generate grid points of a single level.
  
      Args:
          featmap_size (tuple[int, int]): Size of the feature maps.
          stride (int): The stride of corresponding feature map.
          device (str | torch.device): The device the tensor will be put on.
              Defaults to 'cuda'.
  
      Returns:
          torch.Tensor: grid point in a feature map.
      """
      feat_h, feat_w = featmap_size
      shift_x = torch.arange(0.0, feat_w, device=device) * stride
      shift_y = torch.arange(0.0, feat_h, device=device) * stride
      shift_xx, shift_yy = self._meshgrid(shift_x, shift_y)
      stride = shift_x.new_full((shift_xx.shape[0],), stride)
      shifts = torch.stack([shift_xx, shift_yy, stride], dim=-1)
      all_points = shifts.to(device)
      return all_points
  
file_path: mmdetection/mmdet/models/task_modules/prior_generators/point_generator.py
imports: from typing import List, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.registry import TASK_UTILS
label_desc: Use image node_id 2 for calling the PointGenerator obj's underlying member method code with example usage: obj.grid_points(featmap_size, stride, device) and returns: all_points