SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
|
TensorShape describes the shape of a Tensor. More...
#include <tensor.h>
TensorShape describes the shape of a Tensor.
A Tensor's shape is described by three parameters: its dimensions, alignment padding, and a DataLayout.
Public Member Functions | |
TensorShape (std::vector< int > _dims, DataLayout _layout, int _alignment=0) | |
TensorShape (std::initializer_list< int > _dims, DataLayout _layout, int _alignment=0) | |
TensorShape (const TensorShape &shape) | |
TensorShape (const TensorShapeProto &shapeProto) | |
const std::vector< int > & | dims () const |
const std::vector< int > & | padding () const |
Returns a vector of padding along each dimension. | |
int | operator[] (int index) const |
int & | operator[] (int index) |
int | getStorageDim (int index) const |
Returns the alignment-padded size of the specified dimension. | |
bool | operator== (const TensorShape &other) const |
DataLayout | getLayout () const |
int | ndims () const |
int | size () const |
int | storageSize () const |
int | getAlignment () const |
int | getPadding (int index) const |
TensorShapeProto * | asTensorShapeProto () |
Return a TensorShapeProto that serializes this TensorShape. | |
Protected Member Functions | |
int | getIndex (int index) const |
void | computePadding () |
Protected Attributes | |
std::vector< int > | dims_ |
std::vector< int > | padding_ |
Padding along each dimension. More... | |
DataLayout | layout |
int | alignment |
|
protected |