CUDA memory not released by torch.cuda.empty_cache()

Deleting all object and freeing the cache should work as seen in this simple example, so you might need to check if you are still holding references to some objects or if you would need to trigger the garbage collection.