Hi,
This happens because we have a good caching allocator.
When you do x.clone().data_ptr(). You first allocate new memory for the clone, then extract the pointer and delete everything but the value of the pointer. Because cpython is refcounted. The cloned tensor is immediately deleted and so its memory is freed back to the allocator.
When you do y.clone().data_ptr() just after, the same memory space is now free and so the caching allocator returns this space to store the clone of y. Here again, the cloned Tensor will be deleted and only the value of the data pointer will be kept.