# tf.raw_ops.StatelessIf

<br />

output = cond ? then_branch(input) : else_branch(input)

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.StatelessIf`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/StatelessIf)

<br />

    tf.raw_ops.StatelessIf(
        cond, input, Tout, then_branch, else_branch, output_shapes=[], name=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `cond` | A `Tensor`. A Tensor. If the tensor is a scalar of non-boolean type, the scalar is converted to a boolean according to the following rule: if the scalar is a numerical value, non-zero means `True` and zero means False; if the scalar is a string, non-empty means `True` and empty means `False`. If the tensor is not a scalar, being empty means False and being non-empty means True. <br /> This should only be used when the if then/else body functions do not have stateful ops. |
| `input` | A list of `Tensor` objects. A list of input tensors. |
| `Tout` | A list of `tf.DTypes`. A list of output types. |
| `then_branch` | A function decorated with @Defun. A function that takes 'inputs' and returns a list of tensors, whose types are the same as what else_branch returns. |
| `else_branch` | A function decorated with @Defun. A function that takes 'inputs' and returns a list of tensors, whose types are the same as what then_branch returns. |
| `output_shapes` | An optional list of shapes (each a [`tf.TensorShape`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/TensorShape) or list of `ints`). Defaults to `[]`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of `Tensor` objects of type `Tout`. ||

<br />