I have an image of size 2000 x 2000 pixels. I need to find the average from all the 200 x 200 windows. When I try in Matlab to find the average I am able to get the results quickly. However, when I use pytorch it takes a very long time/hangs. How can I quickly find the average of all the windows of size 200x200?
The approach I tried in Pytorch is:
        I = torch.rand(2000,2000)
        pool = nn.AvgPool2d(kernel_size=200, stride=1, padding=100)
        re = pool(I.unsqueeze(0))