How the function torch.nn.AdaptiveAvgPool2d(output_size) works?

Answered here.