<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/ops/box_ops.py#L537-L582) |

Gathers instances by indices.

    tfm.vision.box_ops.gather_instances(
        selected_indices, instances, *aux_instances
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `selected_indices` | a Tensor of shape \[batch, K\] which indicates the selected indices in instance dimension (2nd dimension). |
| `instances` | a Tensor of shape \[batch, N, ...\] where the 2nd dimension is the instance dimension to be selected from. |
| `*aux_instances` | the additional Tensors whose shapes are in \[batch, N, ...\] which are the tensors to be selected from using the `selected_indices`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `selected_instances` | the tensor of shape \[batch, K, ...\] which corresponds to the selected instances of the `instances` tensor. |
| `selected_aux_instances` | the additional tensors of shape \[batch, K, ...\] which corresponds to the selected instances of the `aus_instances` tensors. |

<br />