# tf.tuple

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/ops/control_flow_ops.py#L3010-L3038) |

Groups tensors together.

    tf.tuple(
        tensors, control_inputs=None, name=None
    )

The returned tensors have the same value as the input tensors, but they
are computed only after all the input tensors have been computed.

> [!NOTE]
> **Note:** *In TensorFlow 2 with eager and/or Autograph, you should not require
> this method, as ops execute in the expected order thanks to automatic control
> dependencies.* Only use [`tf.tuple`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/tuple) when working with v1 [`tf.Graph`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/Graph) code.

See also [`tf.group`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/group) and [`tf.control_dependencies`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/control_dependencies).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `tensors` | A list of `Tensor`s or `IndexedSlices`, some entries can be `None`. |
| `control_inputs` | List of additional ops to finish before returning. |
| `name` | (optional) A name to use as a `name_scope` for the operation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Same as `tensors`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `tensors` does not contain any `Tensor` or `IndexedSlices`. |
| `TypeError` | If `control_inputs` is not a list of `Operation` or `Tensor` objects. |

<br />