Sorry, but what you’re doing is completely bogus. 
a = torch.tensor([1, 2, 3])
b = torch.tensor([4, 5])
print(id(a.data)==id(b.data))

gives True, too!
What happens is that a.data and b.data don’t simultaneously exist, but are newly allocated and immediately disposed of objects, and share the same memory address (see documentation of id).
a and b will be distinct Tensors using to the same memory area, a.data and b.data are completely distinct (also from a and b) tensors, too.
I will add "don’t use .data" – see the PyTorch 0.4 migration guide.
Best regards
Thomas