Class ShapeView#

Class Documentation#

class ShapeView#

Lightweight view non-owning class for shape.

Public Functions

inline ShapeView()#

Default constructor.

ShapeView(const ShapeView &other) = default#

Copy constructor.

ShapeView(ShapeView &&other) = default#

Move constructor.

inline ShapeView(const int64_t *data, size_t size)#

Constructor from data and size.

inline ShapeView(const std::initializer_list<int64_t> &other)#

Constructor from initializer list.

inline const int64_t *data() const#

Get the data pointer.

inline size_t size() const#

Get the size of the shape.

inline int64_t Product() const#

Get the product of the shape.

inline const int64_t *begin() const#
Returns:

begin iterator

inline const int64_t *end() const#
Returns:

end iterator

inline bool empty() const#
Returns:

Whether shape tuple is empty

inline int64_t front() const#
Returns:

The first element of the shape tuple

inline int64_t back() const#
Returns:

The last element of the shape tuple

inline int64_t at(size_t idx) const#

Get the i-th element of the shape.