Tenncor
|
#include <shape.hpp>
Public Types | |
using | iterator = ShapeT::iterator |
Type of iterator used to iterate through internal array. More... | |
using | const_iterator = ShapeT::const_iterator |
Type of constant iterator used to iterate through internal array. More... | |
Public Member Functions | |
Shape (void) | |
Shape (std::vector< DimT > dims) | |
Shape (const Shape &other)=default | |
Shape & | operator= (const Shape &other)=default |
Shape & | operator= (const std::vector< DimT > &dims) |
Shape (Shape &&other) | |
Shape & | operator= (Shape &&other) |
DimT | at (RankT idx) const |
Return DimT element at idx for any index in range [0:rank_cap) More... | |
NElemT | n_elems (void) const |
Return the total number of elements represented by the shape. More... | |
bool | compatible_before (const Shape &other, RankT idx) const |
bool | compatible_after (const Shape &other, RankT idx) const |
std::string | to_string (void) const |
Return string representation of shape. More... | |
iterator | begin (void) |
Return begin iterator of internal array. More... | |
iterator | end (void) |
Return end iterator of internal array. More... | |
const_iterator | begin (void) const |
Return begin constant iterator of internal array. More... | |
const_iterator | end (void) const |
Return end constant iterator of internal array. More... | |
Private Member Functions | |
void | vector_assign (const std::vector< DimT > &dims) |
void | move_helper (Shape &&other) |
Private Attributes | |
ShapeT | dims_ |
Array of dimension values. More... | |
Models an aligned shape using an array of DimT values For each DimT at index i, DimT value is number of elements at dimension i For example, shape={3, 2} can model tensor [[x, y, z], [u, v, w]] (In cartesian coordinate, we treat values along the X-axis as dimension 0)
using teq::Shape::const_iterator = ShapeT::const_iterator |
Type of constant iterator used to iterate through internal array.
using teq::Shape::iterator = ShapeT::iterator |
Type of iterator used to iterate through internal array.
|
inline |
|
inline |
|
default |
|
inline |
Return DimT element at idx for any index in range [0:rank_cap)
|
inline |
Return begin iterator of internal array.
|
inline |
Return begin constant iterator of internal array.
Return true if this->dims_[idx:rank_cap) is equal to other.dims_[idx:rank_cap), otherwise return false Set idx to 0 to compare entire shape
Return true if this->dims_[0:idx) is equal to other.dims_[0:idx), otherwise return false
|
inline |
Return end iterator of internal array.
|
inline |
Return end constant iterator of internal array.
|
inlineprivate |
|
inline |
Return the total number of elements represented by the shape.
|
inline |
Return string representation of shape.
|
inlineprivate |
|
private |
Array of dimension values.