Hi,
I think the notion of “reference” that you want here is what we call view: another Tensor that looks at the same memory.
If you want to do that, you will need to make that you only use functions that return views. You can find more details and the list of these functions here:  Tensor Views — PyTorch 1.7.0 documentation 8