If - version 1#
This page documents version 1 of operator If. See If for the latest version (since version 13).
Domain:
ai.onnxSince version: 1
If conditional
Inputs
cond (B): Condition for the if. The tensor must contain a single element.
Outputs
outputs (V): Values that are live-out to the enclosing scope. The return values in the
then_branchandelse_branchmust be of the same shape and same data type.
Attributes
else_branch (graph): Graph to run if condition is false. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the then_branch.
then_branch (graph): Graph to run if condition is true. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the else_branch.
Type Constraints
V: All Tensor types Allowed types: tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8).
B: Only bool Allowed types: tensor(bool).