If

Description

Is a conditional branch operator that selectively executes one of two different subgraphs (then_branch and else_branch) based on a Boolean condition and passes the output of the selected subgraph to the external scope.

Input

cond: input for condition judgment. The tensor must contain one element. The data type can be bool.

Attribute

  • else_branch: branch tensor to run if the condition is false.
  • then_branch: branch tensor to run if the condition is true.

Output

y: value passed to the external scope, which can be a tensor or a tensor sequence.

Constraints

None.

ONNX Opset Support

Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18