How to delete PyTorch objects correctly from memory

Seems to be solved here.