MCPcopy Index your code
hub / github.com/apache/tvm / import_python_module

Method import_python_module

python/tvm/runtime/disco/session.py:193–208  ·  view source on GitHub ↗

Import a python module in each worker This may be required before call Parameters ---------- module_name: str The python module name, as it would be used in a python `import` statement.

(self, module_name: str)

Source from the content-addressed store, hash-verified

191 return DPackedFunc(_ffi_api.SessionGetGlobalFunc(self, name), self) # type: ignore # pylint: disable=no-member
192
193 def import_python_module(self, module_name: str) -> None:
194 """Import a python module in each worker
195
196 This may be required before call
197
198 Parameters
199 ----------
200 module_name: str
201
202 The python module name, as it would be used in a python
203 `import` statement.
204 """
205 if not hasattr(self, "_import_python_module"):
206 self._import_python_module = self.get_global_func("runtime.disco._import_python_module")
207
208 self._import_python_module(module_name)
209
210 def call_packed(self, func: DRef, *args) -> DRef:
211 """Call a PackedFunc on workers providing variadic arguments.

Callers 1

test_callbackFunction · 0.80

Calls 1

get_global_funcMethod · 0.95

Tested by 1

test_callbackFunction · 0.64