Represents the shape of a tensor. More...
#include <gpu.h>
Public Member Functions | |
Shape ()=default | |
Shape (std::initializer_list< size_t > dims) | |
size_t & | operator[] (size_t index) |
const size_t & | operator[] (size_t index) const |
Public Attributes | |
std::array< size_t, kMaxRank > | data = {0} |
size_t | rank = 0 |
Static Public Attributes | |
static constexpr size_t | kMaxRank = 8 |
Represents the shape of a tensor.
The rank of the tensor is the number of dimensions in the shape. The data array stores the size of each dimension. For now, we limit the rank to 8 to avoid dynamic allocation.
|
inlinedefault |
|
inline |
|
inline |
|
inline |