feed_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

Inputs data to a graph.

Prototype

1
feed_data(feed_dict, flow_info=None, timeout=-1, partial_inputs = False) -> int

Parameters

Parameter

Data Type

Description

feed_dict

Dict[FlowData, Union["numpy.ndarray", Tensor, List]]

The key is a FlowData node, and the value is any input that can be converted into numpy.ndarray or dataflow.tensor.

If the value of feed_dict is empty, flow_flags of flow_info must contain DATA_FLOW_FLAG_EOS. In this case, partial_inputs does not take effect.

flow_info

FlowInfo

Set FlowInfo as required. For details, see dataflow.FlowInfo.

timeout

int

Timeout period for inputting data, in ms. The value range is [0, 2147483647), and the value -1 indicates that no timeout will occur.

partial_inputs

bool

Whether feed_dict supports containing only partial inputs of the model whenever the feed_data API is called. The value can be:

  • True: The feed_dict parameter can contain only partial inputs of the model.
  • False: The feed_dict parameter must contain all inputs of the model.

The default value is False.

Returns

0 is returned in normal scenarios.

A specific error code is returned and error logs are printed in abnormal scenarios.

Examples

1
2
3
import dataflow as df
graph = df.FlowGraph(...)
graph.feed_data(...)

Constraints

None