这篇forum信息量很大,先马住: https://discuss.pytorch.org/t/how-can-we-release-gpu-memory-cache/14530
另外还有这篇blog也可以参考