Please refer to the below code snippet:
a = torch.ones(5, requires_grad=True)
y = torch.exp(a)

print(y.grad_fn._saved_result.equal(y)) 
print(y.grad_fn._saved_result is y)     

print(y.data_ptr())
print(y.grad_fn._saved_result.data_ptr())

Output:
True
False
94655401114176
94655401114176

My question is, why the output of print(y.grad_fn._saved_result is y)      is False even though it is evident from the data_ptr() output that both the tensors share the same storage? If they are pointing to the same location, then shouldn’t the comparison with “is” should return True.
Am I missing something here?