map_input

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

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

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 catch DfException and retrieve its error_code and message attributes to check the specific error code and error details. 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