blace.ai
blace::ml_core::Slice Struct Referencefinal

#include <blace_index.h>

Public Member Functions

EXPORT_OR_IMPORT Slice (std::optional< int64_t > start_index=std::nullopt, std::optional< int64_t > stop_index=std::nullopt, std::optional< int64_t > step_index=std::nullopt)
 
int64_t start () const
 
int64_t stop () const
 
int64_t step () const
 

Detailed Description

Struct to describe a subset of a tensors dimension.

Constructor & Destructor Documentation

◆ Slice()

EXPORT_OR_IMPORT blace::ml_core::Slice::Slice ( std::optional< int64_t >  start_index = std::nullopt,
std::optional< int64_t >  stop_index = std::nullopt,
std::optional< int64_t >  step_index = std::nullopt 
)

Construct a slice to select values along a dimension. Slice() will select all values. Slice(3,10) will select values in the range 3 to 10 (exclusive).

Parameters
start_index
stop_index
step_index

Member Function Documentation

◆ start()

int64_t blace::ml_core::Slice::start ( ) const
inline

Return the start value.

Returns

◆ step()

int64_t blace::ml_core::Slice::step ( ) const
inline

Return the step value.

Returns

◆ stop()

int64_t blace::ml_core::Slice::stop ( ) const
inline

Return the end value.

Returns