Solved by KFrank in post #2 
              
              
                Hello Mainul! 

This is due to floating-point round-off error.  It can’t be avoided. 
If you need greater precision, create your tensor as 
dtype = torch.double.  Note, with double precision, you will 
still have round-off error, just less of it. 
Best. 
K. Frank