class_docstr: Compute rotated anchors used by Rotated RPN (RRPN), described in
  "Arbitrary-Oriented Scene Text Detection via Rotation Proposals".
docstr: Generate a tensor storing canonical anchor boxes, which are all anchor
  boxes of different sizes, aspect_ratios, angles centered at (0, 0).
  We can later build the set of anchors for a full feature map by
  shifting and tiling these tensors (see `meth:_grid_anchors`).
  
  Args:
      sizes (tuple[float]):
      aspect_ratios (tuple[float]]):
      angles (tuple[float]]):
  
  Returns:
      Tensor of shape (len(sizes) * len(aspect_ratios) * len(angles), 5)
          storing anchor boxes in (x_ctr, y_ctr, w, h, angle) format.
docstr_tok: ["Generate","a","tensor","storing","canonical","anchor","boxes",",","which","are","all","anchor","boxes","of","different","sizes",",","aspect_ratios",",","angles","centered","at","(","0",",","0",")",".","We","can","later","build","the","set","of","anchors","for","a","full","feature","map","by","shifting","and","tiling","these","tensors","(","see","`","meth",":","_grid_anchors","`",")",".","Args",":","sizes","(","tuple","[","float","]",")",":","aspect_ratios","(","tuple","[","float","]","]",")",":","angles","(","tuple","[","float","]","]",")",":","Returns",":","Tensor","of","shape","(","len","(","sizes",")","*","len","(","aspect_ratios",")","*","len","(","angles",")",",","5",")","storing","anchor","boxes","in","(","x_ctr",",","y_ctr",",","w",",","h",",","angle",")","format","."]
code: def generate_cell_anchors(
      self,
      sizes=(32, 64, 128, 256, 512),
      aspect_ratios=(0.5, 1, 2),
      angles=(-90, -60, -30, 0, 30, 60, 90),
  ):
      """
      Generate a tensor storing canonical anchor boxes, which are all anchor
      boxes of different sizes, aspect_ratios, angles centered at (0, 0).
      We can later build the set of anchors for a full feature map by
      shifting and tiling these tensors (see `meth:_grid_anchors`).
  
      Args:
          sizes (tuple[float]):
          aspect_ratios (tuple[float]]):
          angles (tuple[float]]):
  
      Returns:
          Tensor of shape (len(sizes) * len(aspect_ratios) * len(angles), 5)
              storing anchor boxes in (x_ctr, y_ctr, w, h, angle) format.
      """
      anchors = []
      for size in sizes:
          area = size**2.0
          for aspect_ratio in aspect_ratios:
              # s * s = w * h
              # a = h / w
              # ... some algebra ...
              # w = sqrt(s * s / a)
              # h = a * w
              w = math.sqrt(area / aspect_ratio)
              h = aspect_ratio * w
              anchors.extend([0, 0, w, h, a] for a in angles)
  
      return torch.tensor(anchors)
  
imports: import collections
  import math
  from typing import List
  import torch
  from torch import nn
  from detectron2.config import configurable
  from detectron2.layers import ShapeSpec, move_device_like
  from detectron2.structures import Boxes, RotatedBoxes
  from detectron2.utils.registry import Registry
label_desc: Use image node_id 7 for calling the RotatedAnchorGenerator obj's underlying member method code with example usage: obj.generate_cell_anchors(sizes, aspect_ratios, angles) and returns: torch