# tf.raw_ops.ResourceGather

<br />

Gather slices from the variable pointed to by `resource` according to `indices`.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.ResourceGather(
        resource, indices, dtype, batch_dims=0, validate_indices=True, name=None
    )

`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).
Produces an output tensor with shape `indices.shape + params.shape[1:]` where:

        # Scalar indices
        output[:, ..., :] = params[indices, :, ... :]

        # Vector indices
        output[i, :, ..., :] = params[indices[i], :, ... :]

        # Higher rank indices
        output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `resource` | A `Tensor` of type `resource`. |
| `indices` | A `Tensor`. Must be one of the following types: `int32`, `int64`. |
| `dtype` | A [`tf.DType`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes/DType). |
| `batch_dims` | An optional `int`. Defaults to `0`. |
| `validate_indices` | An optional `bool`. Defaults to `True`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `dtype`. ||

<br />