---
title: "ClikaRT::ops::IndexEntry"
sidebar_label: "IndexEntry"
description: "One subscript position of index / index_put, the standard tensor indexing vocabulary: an int (select), a bool (0-D mask), an integer or boolean Tensor (advanced indexing), an IndexSlice, ellipsis, or…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--class">class</span>

**Header:** `ClikaRT/compute/tensor.h`

One subscript position of [`index`](./index-fn.md#index) / [`index_put`](./index_put.md#index_put), the standard tensor indexing vocabulary: an int (select), a bool (0-D mask), an integer or boolean [Tensor](../Tensor.md) (advanced indexing), an [`IndexSlice`](./IndexSlice.md), [`ellipsis`](./index.md#ellipsis), or [`new_axis`](./index.md#new_axis). A braced integer list indexes via a [Tensor](../Tensor.md) ([`Tensor::from_data`](../Tensor.md#from_data)); pass it as the [Tensor](../Tensor.md) arm.

## Types

### enum Kind {#Kind}

<div class="api-signature">

`enum class` **`Kind`** `:` `std::uint8_t`

</div>

The arm discriminant for [`kind()`](./IndexEntry.md#kind): one value per subscript form the class block enumerates (int select, 0-D bool mask, advanced-index [Tensor](../Tensor.md), slice, ellipsis, new-axis).

| Enumerator | Description |
| --- | --- |
| `Int` |  |
| `Bool` |  |
| `Tensor` |  |
| `Slice` |  |
| `Ellipsis` |  |
| `NewAxis` |  |

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 905

</div>

## Member functions

### IndexEntry(bool) {#IndexEntry}

<div class="api-signature">

**`IndexEntry`**(`bool` `b`)

</div>

The 0-D boolean-mask arm (see the class block's vocabulary).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 908

</div>

### IndexEntry(T) {#IndexEntry-2}

<div class="api-signature">

`template <``typename T`, `typename std::enable_if<std::is_integral<T>::value &&!std::is_same<T, bool>::value, int>::type` `=` `0``>`<br />**`IndexEntry`**(`T` `v`)

</div>

The integer-select arm: picks one position along the dim (kept integral).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 914

</div>

### IndexEntry(Tensor) {#IndexEntry-3}

<div class="api-signature">

**`IndexEntry`**([`Tensor`](../Tensor.md) `t`)

</div>

The advanced-indexing arm: an integer or boolean [Tensor](../Tensor.md) of positions / a mask.

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 916

</div>

### IndexEntry(IndexSlice) {#IndexEntry-4}

<div class="api-signature">

**`IndexEntry`**([`IndexSlice`](./IndexSlice.md) `s`)

</div>

The slice arm: `start:stop:step` bounds.

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 918

</div>

### IndexEntry(EllipsisTag) {#IndexEntry-5}

<div class="api-signature">

**`IndexEntry`**([`EllipsisTag`](./EllipsisTag.md))

</div>

The [`ellipsis`](./index.md#ellipsis) arm: expands to full slices over the dims no other entry names.

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 920

</div>

### IndexEntry(NewAxisTag) {#IndexEntry-6}

<div class="api-signature">

**`IndexEntry`**([`NewAxisTag`](./NewAxisTag.md))

</div>

The [`new_axis`](./index.md#new_axis) arm: inserts a fresh size-1 dim at this position.

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 922

</div>

### kind() {#kind}

<div class="api-signature">

[`Kind`](./IndexEntry.md#Kind) **`kind`**() `const`

</div>

Which arm this entry holds.

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 925

</div>

### bool\_value() {#bool_value}

<div class="api-signature">

`bool` **`bool_value`**() `const`

</div>

The boolean payload; meaningful for [`Kind::Bool`](./IndexEntry.md#Kind).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 927

</div>

### int\_value() {#int_value}

<div class="api-signature">

`std::int64_t` **`int_value`**() `const`

</div>

The integer payload; meaningful for [`Kind::Int`](./IndexEntry.md#Kind).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 929

</div>

### tensor() {#tensor}

<div class="api-signature">

`const` [`Tensor`](../Tensor.md)`&` **`tensor`**() `const`

</div>

The tensor payload; meaningful for [`Kind::Tensor`](./IndexEntry.md#Kind).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 931

</div>

### slice() {#slice}

<div class="api-signature">

`const` [`IndexSlice`](./IndexSlice.md)`&` **`slice`**() `const`

</div>

The slice payload; meaningful for [`Kind::Slice`](./IndexEntry.md#Kind).

<div class="api-declared">

Declared in `ClikaRT/compute/tensor.h`, line 933

</div>
