Solved by KaiHoo in post #4 
              
              
                I do not understand why you need torch.mean to normalize all feature maps to a range of [0, 1]. 
If you want standardized normalization： 
X = torch.randn(1,20,64,64)
X -= X.mean((2,3),keepdim=True)
X /= X.std((2,3),keepdim=True)

If you want them in [0,1]: 
X = torch.randn(1,20,64,64)
X -= X.min()
X…