A difference of approx 1e-6 is explainable due to the float32 precision.
In practice you can ignore it. If you need a higher precision, you could use float64 instead.
Note that your performance will suffer on the GPU.
Here is another example. Clearly the sums should yield the same number. However, due to the order of operations, you will get a small difference between both methods:
x = torch.randn(10, 10, 10)
print(x.sum() - x.sum(0).sum(0).sum(0))
> tensor(-0.000005722)