Atila1:

Do you have any clue why this occurs?


These small errors are most likely caused by the limited floating point precision and a different order of operation as seen here:
x = torch.randn(10, 10, 10)
sum1 = x.sum()
sum2 = x.sum(0).sum(0).sum(0)
print((sum1 - sum2).abs().max())
> tensor(4.7684e-07)




 Atila1:

You can see they are completely different from their float representation.


I cannot reproduce this issue:
x = torch.tensor([214.9400634765625, 205.25238037109375, 204.9016571044922, 207.81027221679688, 204.00399780273438, 203.37063598632812])
y = torch.round(x)
print(y)
> tensor([215., 205., 205., 208., 204., 203.])

and get the expected results. Could you check, if my code snippet reproduces the issue in your setup?