fetch_data

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Function Description

Obtains the graph output data.

Prototype

1
fetch_data(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["Tensor"], FlowInfo, 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_data(...)
graph.fetch_data(...)

Constraints

None