class_docstr: This module generates the default boxes of SSD for a set of feature maps and image sizes.
  
  Args:
      aspect_ratios (List[List[int]]): A list with all the aspect ratios used in each feature map.
      min_ratio (float): The minimum scale :math:`    ext{s}_{        ext{min}}` of the default boxes used in the estimation
          of the scales of each feature map. It is used only if the ``scales`` parameter is not provided.
      max_ratio (float): The maximum scale :math:`    ext{s}_{        ext{max}}`  of the default boxes used in the estimation
          of the scales of each feature map. It is used only if the ``scales`` parameter is not provided.
      scales (List[float]], optional): The scales of the default boxes. If not provided it will be estimated using
          the ``min_ratio`` and ``max_ratio`` parameters.
      steps (List[int]], optional): It's a hyper-parameter that affects the tiling of default boxes. If not provided
          it will be estimated from the data.
      clip (bool): Whether the standardized values of default boxes should be clipped between 0 and 1. The clipping
          is applied while the boxes are encoded in format ``(cx, cy, w, h)``.
class_docstr_tok: ["This","module","generates","the","default","boxes","of","SSD","for","a","set","of","feature","maps","and","image","sizes",".","Args",":","aspect_ratios","(","List","[","List","[","int","]","]",")",":","A","list","with","all","the","aspect","ratios","used","in","each","feature","map",".","min_ratio","(","float",")",":","The","minimum","scale",":","math",":","`","ext","{","s","}","_","{","ext","{","min","}","}","`","of","the","default","boxes","used","in","the","estimation","of","the","scales","of","each","feature","map",".","It","is","used","only","if","the","``","scales","``","parameter","is","not","provided",".","max_ratio","(","float",")",":","The","maximum","scale",":","math",":","`","ext","{","s","}","_","{","ext","{","max","}","}","`","of","the","default","boxes","used","in","the","estimation","of","the","scales","of","each","feature","map",".","It","is","used","only","if","the","``","scales","``","parameter","is","not","provided",".","scales","(","List","[","float","]","]",",","optional",")",":","The","scales","of","the","default","boxes",".","If","not","provided","it","will","be","estimated","using","the","``","min_ratio","``","and","``","max_ratio","``","parameters",".","steps","(","List","[","int","]","]",",","optional",")",":","It","'s","a","hyper-parameter","that","affects","the","tiling","of","default","boxes",".","If","not","provided","it","will","be","estimated","from","the","data",".","clip","(","bool",")",":","Whether","the","standardized","values","of","default","boxes","should","be","clipped","between","0","and","1",".","The","clipping","is","applied","while","the","boxes","are","encoded","in","format","``","(","cx",",","cy",",","w",",","h",")","``","."]
code: def __init__(
      self,
      aspect_ratios: List[List[int]],
      min_ratio: float = 0.15,
      max_ratio: float = 0.9,
      scales: Optional[List[float]] = None,
      steps: Optional[List[int]] = None,
      clip: bool = True,
  ):
      super().__init__()
      if steps is not None and len(aspect_ratios) != len(steps):
          raise ValueError(
              "aspect_ratios and steps should have the same length"
          )
      self.aspect_ratios = aspect_ratios
      self.steps = steps
      self.clip = clip
      num_outputs = len(aspect_ratios)
  
      # Estimation of default boxes scales
      if scales is None:
          if num_outputs > 1:
              range_ratio = max_ratio - min_ratio
              self.scales = [
                  min_ratio + range_ratio * k / (num_outputs - 1.0)
                  for k in range(num_outputs)
              ]
              self.scales.append(1.0)
          else:
              self.scales = [min_ratio, max_ratio]
      else:
          self.scales = scales
  
      self._wh_pairs = self._generate_wh_pairs(num_outputs)
  
imports: import math
  from typing import List, Optional
  import torch
  from torch import nn, Tensor
  from .image_list import ImageList
label_desc: Use image node_id 1 to create a new DefaultBoxGenerator object from inherited base classes: nn with example: obj = DefaultBoxGenerator(aspect_ratios, min_ratio, max_ratio, scales, steps, clip)