See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
"""Slot Attention implementation in PyTorch based on official TensorFlow implementation. | |
Some modifications were made, namely: | |
- Can pass forward previous slots to the next time step. | |
- Dynamic number of slots between calls. | |
- Uses `F.scaled_dot_product_attention` for more performance. | |
""" | |
from typing import Tuple |
This function returns the nearest aspect ratio of a width and height within a limited range of possible aspect ratios.
In other words, while 649x360 technically has an aspect ratio of 649:360, it’s often useful to know that the nearest normal aspect ratio is actually 9:5 (648x360).
nearestNormalAspectRatio(width, height, [side], [maxWidth], [maxHeight])