fetch
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Obtains the graph output data. A serializable output is supported.
Prototype
1 | fetch(indexes=None, timeout=-1) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
indexes |
List[int] |
Indexes of outputs. Values must be unique and in the range [0, N – 1], where N is the number of outputs. One or more indexes can be specified. The default value is None, indicating that all outputs are fetched. Example: [0, 2], indicating that the first and third outputs are fetched. |
timeout |
int |
Timeout period for fetching data, in ms. The value range is [0, 2147483647), and the value -1 indicates that no timeout will occur. |
Returns
Tuple[List["Any"], int] is returned.
In normal scenarios, the last return value of a tuple is 0 (success).
In case of exceptions, the last return value of a tuple indicates the specific error code.
Examples
1 2 3 4 | import dataflow as df graph = df.FlowGraph(...) graph.feed(...) graph.fetch(...) |
Constraints
If an input of the non-dataflow.Tensor type is used, decorators @pyflow and @method must be used together.