code: def valid_flags(self, featmap_size, valid_size, device="cuda"):
      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
  
imports: import torch
  from .builder import ANCHOR_GENERATORS
label_desc: Use image node_id 3 for calling the PointGenerator obj's underlying member method code with example usage: obj.valid_flags(featmap_size, valid_size, device) and returns: valid