Skip to content

Commit 081f7df

Browse files
author
Svetlana Karslioglu
authored
Add torch.cuda.empty_cache() to the reset_seeds function (#2492)
Adding torch.cuda.empty_cache() to the reset_seeds function to solve CUDA out of memory error.
1 parent fb8c2f4 commit 081f7df

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# -- Sphinx-gallery configuration --------------------------------------------
8888

8989
def reset_seeds(gallery_conf, fname):
90+
torch.cuda.empty_cache()
9091
torch.manual_seed(42)
9192
torch.set_default_device(None)
9293
random.seed(10)

0 commit comments

Comments
 (0)