From 27fd4112da205227b1bcb4e46983080f0900ba00 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Tue, 27 Jun 2023 10:41:31 -0700 Subject: [PATCH] Add torch.cuda.empty_cache() to the reset_seeds function Adding torch.cuda.empty_cache() to the reset_seeds function to solve CUDA out of memory error. --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index b70d79b9df6..896fbc1608f 100644 --- a/conf.py +++ b/conf.py @@ -87,6 +87,7 @@ # -- Sphinx-gallery configuration -------------------------------------------- def reset_seeds(gallery_conf, fname): + torch.cuda.empty_cache() torch.manual_seed(42) torch.set_default_device(None) random.seed(10)