What is the algorithm used for torch.nn.AdaptiveAvgPool2d?

@tom explains it beautifully in this post.