ONE - On-device Neural Engine
|
#include <Shape.h>
Public Member Functions | |
Shape (const std::initializer_list< Dim > &dims) | |
Initialize shape with initializer list of dims. | |
Shape (const std::vector< Dim > &shape_vec) | |
Initialize shape with vector of dims. | |
Shape (const std::initializer_list< uint32_t > &shape_vec) | |
Initialize static shape with initializer list of of uint32_t values. | |
size_t | rank () const |
Returns number of dimensions in the shape. | |
Dim | operator[] (const size_t &axis) const |
Returns dimension of the position determined by axis. | |
bool | is_scalar () const |
Returns true if the shape is a scalar. Otherwise, return false. | |
bool | is_dynamic () const |
Returns true if all dimensions in the shape are static or the shape is a scalar. Otherwise, return false. | |
bool | operator== (const Shape &rhs) const |
Returns true of the current shape and the provided rhs are equal. | |
Static Public Member Functions | |
static Shape | scalar () |
Create scalar shape. Note, that the same can be achieved with Shape{}. | |
Shape::Shape | ( | const std::initializer_list< Dim > & | dims | ) |
Shape::Shape | ( | const std::vector< Dim > & | shape_vec | ) |
Shape::Shape | ( | const std::initializer_list< uint32_t > & | shape_vec | ) |
Initialize static shape with initializer list of of uint32_t values.
Exceptions:
Definition at line 28 of file Shape.cpp.
bool Shape::is_dynamic | ( | ) | const |
Returns true if all dimensions in the shape are static or the shape is a scalar. Otherwise, return false.
Definition at line 60 of file Shape.cpp.
References circle_resizer::Dim::is_dynamic(), and is_scalar().
bool Shape::is_scalar | ( | ) | const |
Returns true if the shape is a scalar. Otherwise, return false.
Definition at line 58 of file Shape.cpp.
Referenced by is_dynamic(), circle_resizer::operator<<(), and operator[]().
bool circle_resizer::Shape::operator== | ( | const Shape & | rhs | ) | const |
Returns true of the current shape and the provided rhs are equal.
Dim Shape::operator[] | ( | const size_t & | axis | ) | const |
Returns dimension of the position determined by axis.
Exceptions:
Definition at line 44 of file Shape.cpp.
References is_scalar(), and rank().
size_t circle_resizer::Shape::rank | ( | ) | const |
Returns number of dimensions in the shape.
Referenced by circle_resizer::operator<<(), and operator[]().
|
static |
Create scalar shape. Note, that the same can be achieved with Shape{}.
Definition at line 40 of file Shape.cpp.