Solved by ptrblck in post #2 
              
              
                This small difference is most likely a result of the limited floating point precision, which can be seen e.g. by changing the order of operations: 
x = torch.randn(10, 10, 10)
sum1 = x.sum()
sum2 = x.sum(0).sum(0).sum(0)

print(sum1 - sum2)
> tensor(-3.8147e-06)

Avoiding these differences is espec…