class_docstr: Anchor generator for SSD.
  
  Args:
      strides (list[int]  | list[tuple[int, int]]): Strides of anchors
          in multiple feature levels.
      ratios (list[float]): The list of ratios between the height and width
          of anchors in a single level.
      min_sizes (list[float]): The list of minimum anchor sizes on each
          level.
      max_sizes (list[float]): The list of maximum anchor sizes on each
          level.
      basesize_ratio_range (tuple(float)): Ratio range of anchors. Being
          used when not setting min_sizes and max_sizes.
      input_size (int): Size of feature map, 300 for SSD300, 512 for
          SSD512. Being used when not setting min_sizes and max_sizes.
      scale_major (bool): Whether to multiply scales first when generating
          base anchors. If true, the anchors in the same row will have the
          same scales. It is always set to be False in SSD.
      use_box_type (bool): Whether to warp anchors with the box type data
          structure. Defaults to False.
class_docstr_tok: ["Anchor","generator","for","SSD",".","Args",":","strides","(","list","[","int","]","|","list","[","tuple","[","int",",","int","]","]",")",":","Strides","of","anchors","in","multiple","feature","levels",".","ratios","(","list","[","float","]",")",":","The","list","of","ratios","between","the","height","and","width","of","anchors","in","a","single","level",".","min_sizes","(","list","[","float","]",")",":","The","list","of","minimum","anchor","sizes","on","each","level",".","max_sizes","(","list","[","float","]",")",":","The","list","of","maximum","anchor","sizes","on","each","level",".","basesize_ratio_range","(","tuple","(","float",")",")",":","Ratio","range","of","anchors",".","Being","used","when","not","setting","min_sizes","and","max_sizes",".","input_size","(","int",")",":","Size","of","feature","map",",","300","for","SSD300",",","512","for","SSD512",".","Being","used","when","not","setting","min_sizes","and","max_sizes",".","scale_major","(","bool",")",":","Whether","to","multiply","scales","first","when","generating","base","anchors",".","If","true",",","the","anchors","in","the","same","row","will","have","the","same","scales",".","It","is","always","set","to","be","False","in","SSD",".","use_box_type","(","bool",")",":","Whether","to","warp","anchors","with","the","box","type","data","structure",".","Defaults","to","False","."]
docstr: Generate base anchors.
  
  Returns:
      list(torch.Tensor): Base anchors of a feature grid in multiple                 feature levels.
code: def gen_base_anchors(self) -> List[Tensor]:
      """Generate base anchors.
  
          Returns:
              list(torch.Tensor): Base anchors of a feature grid in multiple \
                  feature levels.
          """
      multi_level_base_anchors = []
      for i, base_size in enumerate(self.base_sizes):
          base_anchors = self.gen_single_level_base_anchors(
              base_size,
              scales=self.scales[i],
              ratios=self.ratios[i],
              center=self.centers[i],
          )
          indices = list(range(len(self.ratios[i])))
          indices.insert(1, len(indices))
          base_anchors = torch.index_select(
              base_anchors, 0, torch.LongTensor(indices)
          )
          multi_level_base_anchors.append(base_anchors)
      return multi_level_base_anchors
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  from mmengine.utils import is_tuple_of
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import HorizontalBoxes
label_desc: Use image node_id 2 for calling the SSDAnchorGenerator obj's underlying member method code with example usage: obj.gen_base_anchors() and returns: multi_level_base_anchors