We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfd652e commit 34b91c9Copy full SHA for 34b91c9
conf.py
@@ -122,11 +122,10 @@ def reset_seeds(gallery_conf, fname):
122
torch.set_default_dtype(torch.float32)
123
torch.set_default_tensor_type(torch.FloatTensor)
124
125
- # Reset torch modules that might have been modified by tutorials
126
- import importlib
127
- importlib.reload(torch)
128
- if 'torchvision' in sys.modules:
129
- importlib.reload(torchvision)
+ # Clean up any global state without reloading
+ if hasattr(torch, "_C"):
+ if hasattr(torch._C, "_jit_clear_class_registry"):
+ torch._C._jit_clear_class_registry()
130
131
gc.collect()
132
0 commit comments