This code reproduces the issue, I think:
import torch
import torch.nn as nn
from torch.autograd import Variable
crit = nn.MSELoss()

####################
torch.manual_seed(876)
a = Variable(torch.randn(3,64,64), requires_grad=True)

torch.manual_seed(875)
b = Variable(torch.randn(3,64,64))
c = crit(a,b)
#####################
torch.manual_seed(874)
d = Variable(torch.randn(3,64,64), requires_grad=True)

torch.manual_seed(873)
e = Variable(torch.randn(3,64,64))
f = crit(d,e)

####################
torch.manual_seed(876)
h = Variable(torch.randn(3,64,64), requires_grad=True)

torch.manual_seed(875)
i = Variable(torch.randn(3,64,64))
j = crit(h,i)
#####################

test = (j, f, c)

g = 0
for loss in test: 
   g+=loss 
g.backward(retain_graph=True)


print("Rounded Results:")
print("Using +=: " + str(float(g)))
print("Using a single float(): " + str( float(j + f + c)  ))
print("Using a single item(): " + str( (j + f + c).item()  ))

print("Working Methods:")
print("Adding j, f, c, separately using float(): " + str(float(j) + float(f) + float(c) ))
print("Adding j, f, c, separately using item(): " + str(j.item() + f.item() + c.item() ))

print("The difference Between Adding Methods:")
print("Difference: " + str( (float(j) + float(f) + float(c)) - float(g) ))

Should I report this as a bug? This “rounding” seem to only occur with loss Variables (and maybe other Variables?), and I can’t recreate it with just regular float numbers. So I assume it’s PyTorch and not Python which has this issue?