Apache SINGA
A distributed deep learning platform .
|
shape of a tensor IMPORTANT NOTE: this shape is different from numpy.shape shape[0] gives the lowest dimension, shape[dimension-1] gives the highest dimension shape[k] corresponds to k-th dimension of tensor More...
#include <tensor.h>
Public Member Functions | |
MSHADOW_XINLINE | Shape (void) |
default constructor, do nothing | |
MSHADOW_XINLINE | Shape (const Shape< dimension > &s) |
constuctor | |
MSHADOW_XINLINE index_t & | operator[] (index_t idx) |
get corresponding index More... | |
MSHADOW_XINLINE const index_t & | operator[] (index_t idx) const |
get corresponding index More... | |
MSHADOW_XINLINE bool | operator== (const Shape< kMaxShape > &s) const |
MSHADOW_XINLINE Shape< 2 > | FlatTo2D (void) const |
MSHADOW_XINLINE size_t | Size (void) const |
MSHADOW_XINLINE size_t | MSize (void) const |
MSHADOW_XINLINE index_t | ProdShape (int dimstart, int dimend) const |
MSHADOW_XINLINE Shape< kSubShape > | SubShape (void) const |
get subshape More... | |
Public Attributes | |
index_t | shape_ [kMaxShape] |
storing the dimension information | |
index_t | stride_ |
storing the stride information in x dimension this is used to deal with pitch allocation in gpu or sse(align x dimension to 64bit) for efficiency | |
Static Public Attributes | |
static const int | kMaxShape = dimension |
maximum dimension of tensor | |
static const int | kSubShape = dimension - 1 |
maximum dimension minus 1 | |
shape of a tensor IMPORTANT NOTE: this shape is different from numpy.shape shape[0] gives the lowest dimension, shape[dimension-1] gives the highest dimension shape[k] corresponds to k-th dimension of tensor
dimension | dimension of tensor |
|
inline |
flatten the higher dimension to second dimension, return a 2D shape
|
inline |
|
inline |
|
inline |
get corresponding index
idx | dimension index |
|
inline |
get corresponding index
idx | dimension index |
|
inline |
dimstart | start dimension |
dimend | end dimension |
|
inline |
|
inline |
get subshape