So when a python variable that refers to a tensor on the GPU directly or indirectly (e.g. by referring to a module that in turn refers to one or more tensors on the GPU) gets reassigned, the GPU memory of all tensors that have been referenced directly or indirectly should be available to get reused?
My problem is that I expected this to happen but it does not appear to happen when I just reassign a variable that points to a torch module on the GPU. Instead I have to first move the module back to the cpu (and manually do `empty_cache() but not sure if this is really required).