Under the hood, to prevent reference cycles, PyTorch has packed the tensor upon saving and unpacked it into a different tensor for reading. Here, the tensor you get from accessing y.grad_fn._saved_result is a different tensor object than x (but they still share the same storage).

It says that the memory location is shared between the objects, but the comparison using “is” return False. As far as I know, “is” return True if two objects are at the same memory location.