I could get a correct result.
it seems
a += b   is deprecated in PyTorch ?
loss = torch.ones(1)*10
a = loss
print(a)
#return tensor([10.])
loss += 20
print(a)
#return tensor([30.])

loss = torch.ones(1)*10
a = loss
print(a)
#return tensor([10.])
loss = 20 + loss
print(a)
#return tensor([10.])