()
| 391 | |
| 392 | |
| 393 | def _swap_torch_modules_to_cache(): |
| 394 | for name, module in list(sys.modules.items()): |
| 395 | if _is_torch_module(name): |
| 396 | if not isinstance(module, ProxyModule): |
| 397 | TORCH_MODULES_CACHE[name] = sys.modules[name] |
| 398 | del sys.modules[name] |
| 399 | |
| 400 | |
| 401 | def _copy_torch_modules_from_cache(): |
no test coverage detected