# tf.keras.backend.gather

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/backend/gather) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L1829-L1840) |

Retrieves the elements of indices `indices` in the tensor `reference`.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.keras.backend.gather`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/gather), \`tf.compat.v2.keras.backend.gather\`

<br />

    tf.keras.backend.gather(
        reference, indices
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `reference` | A tensor. |
| `indices` | An integer tensor of indices. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of same type as `reference`. ||

<br />