code: def __init__(
      self, sizes=(128, 256, 512), aspect_ratios=(0.5, 1.0, 2.0)
  ):
      super(AnchorsGenerator, self).__init__()
  
      if not isinstance(sizes[0], (list, tuple)):
          # TODO change this
          sizes = tuple((s,) for s in sizes)
      if not isinstance(aspect_ratios[0], (list, tuple)):
          aspect_ratios = (aspect_ratios,) * len(sizes)
  
      assert len(sizes) == len(aspect_ratios)
  
      self.sizes = sizes
      self.aspect_ratios = aspect_ratios
      self.cell_anchors = None
      self._cache = {}
  
file_path: deep-learning-for-image-processing/pytorch_object_detection/retinaNet/network_files/anchor_utils.py
imports: from typing import List, Optional, Dict
  import torch
  from torch import nn, Tensor
  from .image_list import ImageList
label_desc: Use image node_id 1 to create a new AnchorsGenerator object from inherited base classes: nn with example: obj = AnchorsGenerator(sizes, aspect_ratios)