feed
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Inputs data to a graph. A serializable input is supported.
Prototype
1 | feed(feed_dict, timeout=-1, partial_inputs = False) -> int |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
feed_dict |
Dict[FlowData, Any] |
The key is a FlowData node, and the value can be any input that can be serialized. To connect to the NPU model, the input must be of the dataflow.Tensor type. |
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 API is called. The value can be:
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(...) |
Constraints
If an input of the non-dataflow.Tensor type is used, decorators @pyflow and @method must be used together.