By ‘del’ not working, I assume you do not observe any change in memory consumption through nvidia-smi.
Pytorch will cache GPU memory, so even though it looks as though the memory hasn’t been freed, but it actually has. If you really want to see the effect on nvidia-smi, you can call torch.cuda.empty_cache(). Doing this you can observe the effect of deleting tensors in nvidia-smi