The difference is most likely created due to the limited floating point precision and a different order of operations as shown in this example:
x = torch.empty(100, 100, 100).uniform_(0, 100)
print(x.sum())
> tensor(49965816.)
print(x.sum(0).sum(0).sum(0))
> tensor(49965808.)

Also, you shouldn’t use the .data attribute, as it might yield unwanted side effects.