라이브러리/PyTorch

gc.collect, torch.cuda.empty_cache()

rongxian 2022. 4. 25. 23:53
  • gc.collect: Forces an immediate garbage collection of all generations
  • torch.cuda.empty_cache(): Releases all unoccupied cached memory currently held by the caching allocator so that those can be used in other GPU application and visible in nvidia-smi