Solved by ptrblck in post #2 
              
              
                The observed differences might be caused by different implementations or different order of the operations. 
Since the differences are at approx. 1e-6 it’s likely the reason in my opinion. 
Have a look at the following code: 
a = torch.randn(10, 10, 10)
b = a.sum()
c = a.sum(2).sum(1).sum(0)
print(b…