shape of a tensor
More...
#include <tensor.h>
|
static const int | kDimension = dimension |
| dimension of current shape More...
|
|
static const int | kSubdim = dimension - 1 |
| dimension of current shape minus one More...
|
|
template<int dimension>
struct mshadow::Shape< dimension >
shape of a tensor
- Template Parameters
-
dimension | dimension of tensor |
◆ Shape() [1/2]
default constructor, do nothing
◆ Shape() [2/2]
◆ FlatTo1D()
flatten the tensor, return a 1D shape
- Returns
- the flat 1d shape
◆ FlatTo2D()
flatten the higher dimension to second dimension, return a 2D shape
- Returns
- the flat 2d shape
◆ operator!=()
- Returns
- whether two shape not equal
- Parameters
-
s | the shape to compare against |
◆ operator==()
- Returns
- whether two shape equals
- Parameters
-
s | the shape to compare against |
◆ operator[]() [1/2]
get corresponding index
- Parameters
-
- Returns
- the corresponding dimension size
◆ operator[]() [2/2]
get corresponding index
- Parameters
-
- Returns
- the corresponding dimension size
◆ ProdShape()
- Returns
- product shape in [dimstart,dimend)
- Parameters
-
dimstart | start dimension |
dimend | end dimension |
◆ Size()
- Returns
- number of valid elements
◆ Slice()
template<int dimension>
template<int dimstart, int dimend>
slice the shape from start to end
- Template Parameters
-
dimstart | start dimension |
dimend | end dimension |
- Returns
- the sliced shape
◆ SubShape()
get subshape that takes off largest dimension v *
- Returns
- subshape
◆ kDimension
dimension of current shape
◆ kSubdim
dimension of current shape minus one
◆ shape_
storing the dimension information
The documentation for this struct was generated from the following file:
- /work/mxnet/3rdparty/mshadow/mshadow/tensor.h