Call a PackedFunc on workers providing variadic arguments. Parameters ---------- func : PackedFunc The function to be called. *args : various types In the variadic arguments, the supported types include: - integers and floating poi
(self, func: DRef, *args)
| 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. |
| 212 | |
| 213 | Parameters |
| 214 | ---------- |
| 215 | func : PackedFunc |
| 216 | The function to be called. |
| 217 | *args : various types |
| 218 | In the variadic arguments, the supported types include: |
| 219 | - integers and floating point numbers; |
| 220 | - DLDataType; |
| 221 | - DLDevice; |
| 222 | - str (std::string in C++); |
| 223 | - DRef. |
| 224 | |
| 225 | Returns |
| 226 | ------- |
| 227 | return_value : various types |
| 228 | The return value of the function call. |
| 229 | |
| 230 | Notes |
| 231 | ----- |
| 232 | Examples of unsupported types: |
| 233 | - Tensor, DLTensor,; |
| 234 | - TVM Objects, including PackedFunc, Module and String. |
| 235 | """ |
| 236 | return _ffi_api.SessionCallPacked(self, 0, 0, func, *args) # type: ignore # pylint: disable=no-member |
| 237 | |
| 238 | def _sync_worker(self, worker_id: int) -> None: |
| 239 | """Synchronize the controller with a worker, and it will wait until the worker finishes |
no outgoing calls