def _ratio_enum(anchor, ratios):
    """
    Enumerate a set of anchors for each aspect ratio wrt an anchor.
    """

    width, height, x_ctr, y_ctr = _whctrs(anchor)
    size = width * height
    size_ratios = size / ratios
    widths = np.round(np.sqrt(size_ratios))
    heights = np.round(widths * ratios)
    anchors = _mkanchors(widths, heights, x_ctr, y_ctr)
    return anchors
Enumerate a set of anchors for each aspect ratio wrt an anchor.
python/aitemplate/frontend/nn/proposal.py