转:pytorch 显存的优化利用,torch.cuda.empty_cache() torch.cuda.empty_cache()的作用 【摘自https://zhuanlan.zhihu.com/p/76459295】 显存优化 可参考: pytorch 减小显存消耗,优化显存使用,避免out of memory 再次浅谈Pytorch中的显存利用问题(附完善显存跟踪代码)