Set the inputs to a function. This interface works when using VM over RPC by internally converting Tensor in the arguments to DLTensor, which is supported in RPC where remote could only have a minimal C runtime. Note: If `set_input` is used, the function *must* be ca
(self, func_name: str, *args: Any, **kwargs: Any)
| 248 | return new_args |
| 249 | |
| 250 | def set_input(self, func_name: str, *args: Any, **kwargs: Any) -> None: |
| 251 | """Set the inputs to a function. |
| 252 | This interface works when using VM over RPC by internally converting Tensor in |
| 253 | the arguments to DLTensor, which is supported in RPC where remote could only |
| 254 | have a minimal C runtime. |
| 255 | |
| 256 | Note: If `set_input` is used, the function *must* be called using `invoke_stateful` |
| 257 | and the results must be obtained using `get_outputs`. |
| 258 | |
| 259 | Parameters |
| 260 | ---------- |
| 261 | func_name : str |
| 262 | The name of the function. |
| 263 | args: List[tvm.runtime.Tensor] or List[np.ndarray] |
| 264 | The arguments to the function. |
| 265 | kwargs: dict of str to tvm.runtime.Tensor or np.ndarray |
| 266 | Named arguments to the function. |
| 267 | """ |
| 268 | cargs: list[Any] = [] |
| 269 | |
| 270 | if kwargs: |
| 271 | args = self._convert_func_named_args(func_name, args, **kwargs) |
| 272 | |
| 273 | for arg in args: |
| 274 | self._convert(arg, cargs) |
| 275 | |
| 276 | self._set_input(func_name, *cargs) |
| 277 | |
| 278 | def invoke_stateful(self, func_name: str) -> None: |
| 279 | """ |