map_input

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

Maps inputs to FlowNode, indicating that the node_input_index input of FlowNode is sent to the pp_input_index input of ProcessPoint, all attributes in attr are set for the input of ProcessPoint, and the mapped FlowNode is returned. This function is optional. If it is not called, the inputs of FlowNode and ProcessPoint are mapped in sequence by default.

Prototype

1
map_input(node_input_index, pp, pp_input_index, input_attrs=[])

Parameters

Parameter

Data Type

Value Description

node_input_index

int

Input index of FlowNode. The value is less than or equal to the number of inputs.

pp

Union[GraphProcessPoint, FuncProcessPoint]

pp mapped from FlowNode. The value can be GraphProcessPoint or FuncProcessPoint.

pp_input_index

int

Input index of pp.

input_attrs

List[Union[TimeBatch, CountBatch]]

Attribute set. Currently, TimeBatch and CountBatch are supported.

Returns

None is returned in normal scenarios.

The DfException exception is reported in abnormal scenarios. You can obtain error_code and message in DfException to view the error code and error information. For details, see DataFlow Error Codes.

Examples

1
2
3
4
5
6
7
import dataflow as df
pp = df.FuncProcessPoint(...)
flow_node = df.FlowNode(input_num=2, output_num=1)
flow_node.add_process_point(pp)
flow_node.map_input(0, pp, 1)
flow_node.map_input(1, pp, 0)
flow_node_out = flow_node(data0, data1)

Constraints

None