ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ndarray::Strides Struct Reference

#include <Array.h>

Data Structures

struct  _calc_offset
 
struct  _calc_offset< index_sequence< Num >, T >
 
struct  _calc_offset< index_sequence< Num, Nums... >, T, Ts... >
 

Public Member Functions

 Strides (Shape s)
 
int operator[] (size_t idx) const noexcept
 
template<typename Seq , typename... Ts>
constexpr size_t offset (Seq, Ts... x) const noexcept
 

Detailed Description

Definition at line 40 of file Array.h.

Constructor & Destructor Documentation

◆ Strides()

ndarray::Strides::Strides ( Shape  s)
inlineexplicit

Definition at line 42 of file Array.h.

42: _strides{} { fillStrides(s); }

Member Function Documentation

◆ offset()

template<typename Seq , typename... Ts>
constexpr size_t ndarray::Strides::offset ( Seq  ,
Ts...  x 
) const
inlineconstexprnoexcept

Definition at line 67 of file Array.h.

68 {
69 // return ( 0 + ... + (std::get<Nums>(_strides) * x)); in c++14
70 return _calc_offset<Seq, Ts...>::get(_strides, x...);
71 }

◆ operator[]()

int ndarray::Strides::operator[] ( size_t  idx) const
inlinenoexcept

Definition at line 44 of file Array.h.

44{ return _strides[idx]; }

The documentation for this struct was generated from the following file: