class_docstr: Side-Aware Boundary Localization (SABL) for RetinaNet.
  
  The anchor generation, assigning and sampling in SABLRetinaHead
  are the same as GuidedAnchorHead for guided anchoring.
  
  Please refer to https://arxiv.org/abs/1912.04260 for more details.
  
  Args:
      num_classes (int): Number of classes.
      in_channels (int): Number of channels in the input feature map.
      stacked_convs (int): Number of Convs for classification             and regression branches. Defaults to 4.
      feat_channels (int): Number of hidden channels.             Defaults to 256.
      approx_anchor_generator (dict): Config dict for approx generator.
      square_anchor_generator (dict): Config dict for square generator.
      conv_cfg (dict): Config dict for ConvModule. Defaults to None.
      norm_cfg (dict): Config dict for Norm Layer. Defaults to None.
      bbox_coder (dict): Config dict for bbox coder.
      reg_decoded_bbox (bool): Whether to regress decoded bbox.             Defaults to False.
      train_cfg (dict): Training config of SABLRetinaHead.
      test_cfg (dict): Testing config of SABLRetinaHead.
      loss_cls (dict): Config of classification loss.
      loss_bbox_cls (dict): Config of classification loss for bbox branch.
      loss_bbox_reg (dict): Config of regression loss for bbox branch.
docstr: Get squares according to feature map sizes and guided anchors.
  
  Args:
      featmap_sizes (list[tuple]): Multi-level feature map sizes.
      img_metas (list[dict]): Image meta info.
      device (torch.device | str): device for returned tensors
  
  Returns:
      tuple: square approxs of each image
docstr_tok: ["Get","squares","according","to","feature","map","sizes","and","guided","anchors",".","Args",":","featmap_sizes","(","list","[","tuple","]",")",":","Multi-level","feature","map","sizes",".","img_metas","(","list","[","dict","]",")",":","Image","meta","info",".","device","(","torch.device","|","str",")",":","device","for","returned","tensors","Returns",":","tuple",":","square","approxs","of","each","image"]
code: def get_anchors(self, featmap_sizes, img_metas, device="cuda"):
      """Get squares according to feature map sizes and guided anchors.
  
      Args:
          featmap_sizes (list[tuple]): Multi-level feature map sizes.
          img_metas (list[dict]): Image meta info.
          device (torch.device | str): device for returned tensors
  
      Returns:
          tuple: square approxs of each image
      """
      num_imgs = len(img_metas)
  
      # since feature map sizes of all images are the same, we only compute
      # squares for one time
      multi_level_squares = self.square_anchor_generator.grid_anchors(
          featmap_sizes, device=device
      )
      squares_list = [multi_level_squares for _ in range(num_imgs)]
  
      return squares_list
  
imports: import numpy
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
  from mmcv.runner import force_fp32
  from mmdet.core import build_anchor_generator, build_assigner, build_bbox_coder, build_sampler, images_to_levels, multi_apply, multiclass_nms, unmap
  from ..builder import HEADS, build_loss
  from .base_dense_head import BaseDenseHead
  from .guided_anchor_head import GuidedAnchorHead
label_desc: Use image node_id 6 for calling the SABLRetinaHead obj's underlying member method code with example usage: obj.get_anchors(featmap_sizes, img_metas, device) and returns: squares_list