If#

If - 1#

Version

  • name: If (GitHub)

  • domain: main

  • since_version: 1

  • function:

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1.

Summary

Attributes

  • else_branch - GRAPH (required) : 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 (required) : 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.

Inputs

  • cond (heterogeneous) - B:

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - V:

Type Constraints

  • V in ( 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) ): All Tensor types

  • B in ( tensor(bool) ): Only bool