The following snippet outputs either 0. or values close to -1e-3:
for _ in range(10):
    a = torch.empty((3,))
    a.uniform_(1000,10000)
    print(a.sum() - a[[2, 1, 0]].sum())

torch.__version__ is 1.0.1.post2
Is there any reason why the snippet above should output values different from 0? I also experimented with cuda and I get similar values.