OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
opennn::Shape Struct Reference

#include <tensor_utilities.h>

Public Member Functions

 Shape () noexcept=default
 
 Shape (size_t new_rank, Index value)
 
 Shape (initializer_list< Index > list)
 
const Index * begin () const noexcept
 
const Index * end () const noexcept
 
const Index & operator[] (size_t i) const noexcept
 
Index & operator[] (size_t i) noexcept
 
Index & back ()
 
const Index & back () const
 
bool empty () const noexcept
 
Index size () const noexcept
 
void clear () noexcept
 
void push_back (Index value) noexcept
 
bool operator== (const Shape &other) const noexcept
 
bool operator!= (const Shape &other) const noexcept
 
Shapeappend (const Shape &other)
 

Public Attributes

Index dims [MaxRank] = {0}
 
size_t rank = 0
 

Static Public Attributes

static constexpr size_t MaxRank = 4
 

Friends

ostream & operator<< (ostream &os, const Shape &shape)
 

Constructor & Destructor Documentation

◆ Shape() [1/3]

opennn::Shape::Shape ( )
defaultnoexcept

◆ Shape() [2/3]

opennn::Shape::Shape ( size_t new_rank,
Index value )
inline

◆ Shape() [3/3]

opennn::Shape::Shape ( initializer_list< Index > list)
inline

Member Function Documentation

◆ append()

Shape & opennn::Shape::append ( const Shape & other)
inline

◆ back() [1/2]

Index & opennn::Shape::back ( )
inline

◆ back() [2/2]

const Index & opennn::Shape::back ( ) const
inline

◆ begin()

const Index * opennn::Shape::begin ( ) const
inlinenoexcept

◆ clear()

void opennn::Shape::clear ( )
inlinenoexcept

◆ empty()

bool opennn::Shape::empty ( ) const
inlinenoexcept

◆ end()

const Index * opennn::Shape::end ( ) const
inlinenoexcept

◆ operator!=()

bool opennn::Shape::operator!= ( const Shape & other) const
inlinenoexcept

◆ operator==()

bool opennn::Shape::operator== ( const Shape & other) const
inlinenoexcept

◆ operator[]() [1/2]

const Index & opennn::Shape::operator[] ( size_t i) const
inlinenoexcept

◆ operator[]() [2/2]

Index & opennn::Shape::operator[] ( size_t i)
inlinenoexcept

◆ push_back()

void opennn::Shape::push_back ( Index value)
inlinenoexcept

◆ size()

Index opennn::Shape::size ( ) const
inlinenoexcept

Friends And Related Symbol Documentation

◆ operator<<

ostream & operator<< ( ostream & os,
const Shape & shape )
friend

Member Data Documentation

◆ dims

Index opennn::Shape::dims[MaxRank] = {0}

◆ MaxRank

size_t opennn::Shape::MaxRank = 4
staticconstexpr

◆ rank

size_t opennn::Shape::rank = 0