Skip to main content

ClikaRT::ops::IndexEntry

class

Header: ClikaRT/compute/tensor.h

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 new_axis. A braced integer list indexes via a Tensor (Tensor::from_data); pass it as the Tensor arm.

Types​

enum Kind​

enum class Kind : std::uint8_t

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

EnumeratorDescription
Int
Bool
Tensor
Slice
Ellipsis
NewAxis

Declared in ClikaRT/compute/tensor.h, line 880

Member functions​

IndexEntry(bool)​

IndexEntry(bool b)

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

Declared in ClikaRT/compute/tensor.h, line 883

IndexEntry(T)​

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

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

Declared in ClikaRT/compute/tensor.h, line 889

IndexEntry(Tensor)​

IndexEntry(Tensor t)

The advanced-indexing arm: an integer or boolean Tensor of positions / a mask.

Declared in ClikaRT/compute/tensor.h, line 891

IndexEntry(IndexSlice)​

IndexEntry(IndexSlice s)

The slice arm: start:stop:step bounds.

Declared in ClikaRT/compute/tensor.h, line 893

IndexEntry(EllipsisTag)​

IndexEntry(EllipsisTag)

The ellipsis arm: expands to full slices over the dims no other entry names.

Declared in ClikaRT/compute/tensor.h, line 895

IndexEntry(NewAxisTag)​

IndexEntry(NewAxisTag)

The new_axis arm: inserts a fresh size-1 dim at this position.

Declared in ClikaRT/compute/tensor.h, line 897

kind()​

Kind kind() const

Which arm this entry holds.

Declared in ClikaRT/compute/tensor.h, line 900

bool_value()​

bool bool_value() const

The boolean payload; meaningful for Kind::Bool.

Declared in ClikaRT/compute/tensor.h, line 902

int_value()​

std::int64_t int_value() const

The integer payload; meaningful for Kind::Int.

Declared in ClikaRT/compute/tensor.h, line 904

tensor()​

const Tensor& tensor() const

The tensor payload; meaningful for Kind::Tensor.

Declared in ClikaRT/compute/tensor.h, line 906

slice()​

const IndexSlice& slice() const

The slice payload; meaningful for Kind::Slice.

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