Solved by albanD in post #2 
              
              
                Hi, 
This is most likely due to precision errors of floats. 
Do you see the same behavior if you run with double by setting torch.set_default_tensor_type(torch.DoubleTensor).