CUDA semantics — PyTorch 1.10.1 documentation
pytorch.org › docs › stabletorch.backends.cuda.cufft_plan_cache.clear() clears the cache. To control and query plan caches of a non-default device, you can index the torch.backends.cuda.cufft_plan_cache object with either a torch.device object or a device index, and access one of the above attributes. E.g., to set the capacity of the cache for device 1, one can write torch.backends.cuda.cufft_plan_cache[1].max_size = 10.
About torch.cuda.empty_cache() - PyTorch Forums
discuss.pytorch.org › t › about-torch-cuda-emptyJan 09, 2019 · About torch.cuda.empty_cache () lixin4ever January 9, 2019, 9:16am #1. Recently, I used the function torch.cuda.empty_cache () to empty the unused memory after processing each batch and it indeed works (save at least 50% memory compared to the code not using this function). At the same time, the time cost does not increase too much and the current results (i.e., the evaluation scores on the testing dataset) are more or less OK.