If - version 1#

This page documents version 1 of operator If. See If for the latest version (since version 13).

  • Domain: ai.onnx

  • Since 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_branch and else_branch must be of the same shape and same data type.

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).