Solved by KFrank in post #2 
              
              
                Hi George! 

I believe that your discrepancy is due to (accumulated) round-off 
error. 
An easy way to test this is to repeat your computation using double 
precision (by using torch.double tensors).  If the discrepancy is due 
to round-off error it should drop dramatically, say to about 1e-13.  If …