# tf.raw_ops.Case

<br />

An n-way switch statement which calls a single branch function.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.Case(
        branch_index, input, Tout, branches, output_shapes=[], name=None
    )

    An n-way switch statement, implementing the following:

    ```
    switch (branch_index) {
      case 0:
        output = branches[0](input);
        break;
      case 1:
        output = branches[1](input);
        break;
      ...
      case [[nbranches-1]]:
      default:
        output = branches[nbranches-1](input);
        break;
    }
    ```

<br />

<br />

<br />

| ## Args ||
|---|---|
| `branch_index` | A `Tensor` of type `int32`. The branch selector, an int32 Tensor. |
| `input` | A list of `Tensor` objects. A list of input tensors passed to the branch function. |
| `Tout` | A list of `tf.DTypes`. A list of output types. |
| `branches` | A list of functions decorated with @Defun that has length `>= 1`. A list of functions each of which takes 'inputs' and returns a list of tensors, whose types are the same as what every other 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 />