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)
| 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. |