Solved by Jack_Rolph in post #3 
              
              
                Suppose I have a tensor, a 
a = torch.Tensor(B,C,X,Y)

I am trying to normalize the Y axis to its Z-score taken along statistics in X. However, some of the elements along the channel dimension, C, are degenerate. 
This means I am only interested with those C elements that have a non-zero standard de…