fetch
Applicable Products
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 |
Value Description |
|---|---|---|
indexes |
List[int] |
Index of the output data, which must be unique. The value range is [0, N – 1], where N indicates the number of output data records. One or more values are supported. The default value is None, indicating that all outputs are fetched. For example, [0, 2] indicates 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.