MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / load_module

Function load_module

imperative/python/megengine/hub/tools.py:9–19  ·  view source on GitHub ↗

r"""Loads module specified by name and path. Args: name: module name. path: module path.

(name: str, path: str)

Source from the content-addressed store, hash-verified

7
8
9def load_module(name: str, path: str) -> types.ModuleType:
10 r"""Loads module specified by name and path.
11
12 Args:
13 name: module name.
14 path: module path.
15 """
16 spec = importlib.util.spec_from_file_location(name, path)
17 module = importlib.util.module_from_spec(spec)
18 spec.loader.exec_module(module)
19 return module
20
21
22def check_module_exists(module: str) -> bool:

Callers 1

_init_hubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected