map_output

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 outputs to FlowNode, indicating that the pp_output_index output of pp is sent to the node_output_index output of FlowNode and then the mapped FlowNode is returned.

This method is optional. If this method is used, the outputs of FlowNode and pp are mapped in sequence by default.

Prototype

1
map_output(node_output_index, pp, pp_output_index)

Parameters

Parameter

Data Type

Value Description

node_output_index

int

Output index of FlowNode.

pp

Union[GraphProcessPoint, FuncProcessPoint]

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

pp_output_index

int

Output index of pp.

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
 8
 9
10
import dataflow as df
pp = df.FuncProcessPoint(...)
flow_node = df.FlowNode(input_num=2, output_num=2) 
flow_node.add_process_point(pp)
flow_node.map_input(0, pp, 0) 
flow_node.map_input(1, pp, 1) 
flow_node.map_output(0, pp, 1)  
flow_node.map_output(1, pp, 0) 
# Construct an edge relationship.
flow_node_out = flow_node(data, data1)

Constraints

None