MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _swap_torch_modules_to_cache

Function _swap_torch_modules_to_cache

python/paddle/compat/proxy.py:393–398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

391
392
393def _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
401def _copy_torch_modules_from_cache():

Callers 1

enable_torch_proxyFunction · 0.85

Calls 3

listFunction · 0.85
_is_torch_moduleFunction · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected