FilesLast commitLast update
10 days ago
19 days ago
19 days ago
19 days ago
19 days ago
19 days ago
9 days ago
README

SwitchN

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products √
Atlas inference products √
Atlas training products √

Function Description

SwitchN is a basic control flow operator. It forwards the input tensor data to the corresponding output port based on the integer tensor input pred_value. output is a dynamic output, in which only one output receives data, and its shape and data type are the same as those of the input data. This operator usually works with the Merge operator to implement multi-way branch control.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
data Input The tensor to be forwarded. float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool ND
pred_value Input An int64 tensor that determines the output port to which the data is forwarded. DT_INT64 ND
output Dynamic output Output tensors, one of which receives data. The data type is the same as that of data. float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool ND

Constraint Description

  • The data type of the input data must be one of float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool.
  • The data type of the input pred_value must be DT_INT64.

Invocation Description

The SwitchN operator is a basic control flow operator. It is usually used as a multi-way branch selection node in a graph, and is not invoked separately.

Invocation Method Invocation Sample Description
Graph-mode invocation test_geir_switch_n Invokes the SwitchN operator by building a graph through the operator IR.