Solved by vainaijr in post #2 
              
              
                if we do, 
x.mean(3).mean(0).mean(0)

then it would give same result 
basically, 
if we have tensor 
x = torch.randn(a, b, c, d)

and we apply 
torch.mean(x, dim=0)

then its shape would be 
torch.Size([b, c, d])

so here, when we do, 
x = torch.tensor([[[[ 1.,  3.],
          [ 4.,  6.]],

        …