Global Average Pooling in Pytorch

x = nn.avg_pool2d(x, x.size()[2:]) works fine when x.shape=N * C * H * W

5 Likes