---
title: "ClikaRT::ops::IndexBound"
sidebar_label: "IndexBound"
description: "An integer-typed op bound, a reshape dim: either a concrete int64_t literal or a 0-D/1-D integer Tensor (e.g."
---

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

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

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

An integer-typed op bound, a reshape dim: either a concrete `int64_t` literal or a 0-D/1-D integer [Tensor](../Tensor.md) (e.g. a [`shape_host`](./shape_host.md#shape_host) read), so a shape-consuming argument composes without pulling concrete sizes to the host. Narrower than [`ScalarOrTensor`](./ScalarOrTensor.md) by design: no float ctor ([`reshape`](./reshape.md#reshape)`(x, {1.5})` fails at compile time) and `bool` is deleted (it would otherwise promote silently to an index).

## Member functions

### IndexBound() {#IndexBound}

<div class="api-signature">

**`IndexBound`**() `=default`

</div>

Absent: a slice slot left open ("from the beginning" / "to the end"). A reshape dim must not be absent (the op refuses it).

<div class="api-declared">

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

</div>

### IndexBound(nullopt\_t) {#IndexBound-2}

<div class="api-signature">

**`IndexBound`**(`std::nullopt_t`)

</div>

Absent, spelled `std::nullopt` (the same open-bound meaning as the default ctor).

<div class="api-declared">

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

</div>

### IndexBound(T) {#IndexBound-3}

<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 />**`IndexBound`**(`T` `v`)

</div>

A concrete integer bound; any integral width, kept exact.

<div class="api-declared">

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

</div>

### IndexBound(Tensor) {#IndexBound-4}

<div class="api-signature">

**`IndexBound`**([`Tensor`](../Tensor.md) `tensor`)

</div>

A tensor bound (0-D/1-D integer [Tensor](../Tensor.md)); consumed on-device, no host sync.

<div class="api-declared">

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

</div>

### IndexBound(bool) {#IndexBound-5}

<div class="api-signature">

**`IndexBound`**(`bool`) `=delete`

</div>

<div class="api-declared">

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

</div>

### has\_value() {#has_value}

<div class="api-signature">

`bool` **`has_value`**() `const`

</div>

True when a bound is present (integer or tensor); absent = open.

<div class="api-declared">

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

</div>

### is\_tensor() {#is_tensor}

<div class="api-signature">

`bool` **`is_tensor`**() `const`

</div>

True for the tensor arm.

<div class="api-declared">

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

</div>

### is\_int() {#is_int}

<div class="api-signature">

`bool` **`is_int`**() `const`

</div>

True for the integer arm.

<div class="api-declared">

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

</div>

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

<div class="api-signature">

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

</div>

The integer bound; meaningful when [`is_int()`](./IndexBound.md#is_int).

<div class="api-declared">

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

</div>

### tensor() {#tensor}

<div class="api-signature">

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

</div>

The tensor bound; meaningful when [`is_tensor()`](./IndexBound.md#is_tensor).

<div class="api-declared">

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

</div>
