Get the value output by the function by the given name after a call of `invoke_stateful`. It is an error to call this function without first calling `invoke_stateful`. Parameters ---------- func_name: str The name of the function whose o
(self, func_name: str)
| 292 | self._invoke_stateful(func_name) |
| 293 | |
| 294 | def get_outputs(self, func_name: str) -> tvm.Object | tuple[Any]: |
| 295 | """ |
| 296 | Get the value output by the function by the given name |
| 297 | after a call of `invoke_stateful`. |
| 298 | |
| 299 | It is an error to call this function without first calling `invoke_stateful`. |
| 300 | |
| 301 | Parameters |
| 302 | ---------- |
| 303 | func_name: str |
| 304 | The name of the function whose output should be fetched. |
| 305 | |
| 306 | Returns |
| 307 | ------- |
| 308 | ret: Union[tvm.Object, Tuple[Any]] |
| 309 | The result of the earlier call to the function via `invoke_stateful`. |
| 310 | If the result is a tuple, it returns a list of the fields. |
| 311 | The fields are potentially also tuples, so these can be arbitrily nested. |
| 312 | """ |
| 313 | |
| 314 | # to deal with potentially nested tuples, we need to query for arity recursively |
| 315 | def get_output_rec(func_name, *idx): |
| 316 | arity = self._get_output_arity(func_name, *idx) |
| 317 | if arity == -1: |
| 318 | return self._get_output(func_name, *idx) |
| 319 | # otherwise we need to specify more indices |
| 320 | idx_list = list(idx) |
| 321 | return tuple(get_output_rec(func_name, *(idx_list + [i])) for i in range(arity)) |
| 322 | |
| 323 | return get_output_rec(func_name) |
| 324 | |
| 325 | def set_instrument(self, instrument: Function) -> None: |
| 326 | """Set an instrumentation function. |
no outgoing calls