Solved by ptrblck in post #2 
              
              
                Different algorithms could be used for different input shapes, which would thus create the small errors due to the limited numerical precision. 
E.g. a different order of operations would also create these numerical differences as seen here: 
x = torch.randn(10, 10, 10)
s1 = x.sum()
s2 = x.sum(0).su…