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 f3bc0ca commit fe0bf00Copy full SHA for fe0bf00
intermediate_source/memory_format_tutorial.py
@@ -379,14 +379,17 @@ def attribute(m):
379
import gc
380
import sys
381
382
-if torch.nn.functional in old_attrs:
383
- for k, v in old_attrs[torch.nn.functional].items():
384
- setattr(torch.nn.functional, k, v)
385
-
386
torch._dynamo.reset()
387
if torch.cuda.is_available():
388
torch.cuda.empty_cache()
389
+gc.collect()
+
+if hasattr(torch, "_check_wrapper_patched"):
+ delattr(torch, "_check_wrapper_patched")
390
391
+old_attrs.clear()
392
393
######################################################################
394
# Work to do
395
# ----------
0 commit comments