Hmm, thanks! It’s especially interesting trying to deal with CUDA/PyTorch/deep learning memory issues, since there is both cpu ( can be fixed via gc.collect() and del statements) and gpu (as you mentioned, torch.cuda.empty_cache())