I find the below behavior in both Windows and Linux under version 0.4.1
torch.set_printoptions(precision=20)
torch.tensor([123456789.])
>>> tensor([ 123456792.])
Likewise:
torch.set_printoptions(precision=20)
x = torch.FloatTensor([1.23423424578349539453434])
print(x,x.data)
>>> tensor([1.23423421382904052734]) tensor([1.23423421382904052734])
I understand that this has been addressed in this pull request https://github.com/pytorch/pytorch/pull/12746 but perhaps it’s not yet available in the latest version?