# tf.compat.v1.batch_gather

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/array_ops.py#L5161-L5174) |

Gather slices from params according to indices with leading batch dims. (deprecated)

    tf.compat.v1.batch_gather(
        params, indices, name=None
    )

> [!WARNING]
> **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed after 2017-10-25. Instructions for updating: `tf.batch_gather` is deprecated, please use [`tf.gather`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/gather) with `batch_dims=tf.rank(indices) - 1` instead.