tensor container that does memory allocation and resize like STL, use it to save the lines of FreeSpace in class. Do not abuse it, efficiency can come from pre-allocation and no re-allocation
More...
|
| TensorContainer (bool pad=MSHADOW_ALLOC_PAD) |
| constructor More...
|
|
| TensorContainer (const Shape< dimension > &shape) |
| constructor More...
|
|
| TensorContainer (const Shape< dimension > &shape, real_t initv) |
| constructor More...
|
|
void | Resize (const Shape< dimension > &shape) |
| resize the container to given shape, content is NOT preserved More...
|
|
void | Resize (const Shape< dimension > &shape, real_t initv) |
| resize the container to given shape, and initialize, content is NOT preserved More...
|
|
void | set_pad (bool pad) |
| set whether padding is allowed in tensor
|
|
template<typename TStream > |
void | SaveBinary (TStream &fo) const |
| save by binary format More...
|
|
template<typename TStream > |
void | LoadBinary (TStream &fi) |
| load by binary format, a temp Tensor<cpu,dim> storage will be allocated More...
|
|
Tensor< Device, dimension > & | operator= (real_t s) |
|
template<typename E > |
Tensor< Device, dimension > & | operator= (const expr::Exp< E, expr::type::kMapper > &exp) |
|
template<typename E > |
Tensor< Device, dimension > & | operator= (const expr::Exp< E, expr::type::kComplex > &exp) |
|
Public Member Functions inherited from mshadow::Tensor< Device, dimension > |
MSHADOW_XINLINE | Tensor (void) |
| default constructor
|
|
MSHADOW_XINLINE | Tensor (const Shape< dimension > &shape) |
| constructor from shape
|
|
MSHADOW_XINLINE | Tensor (real_t *dptr, const Shape< dimension > &shape) |
| constructor from data pointer and shape
|
|
MSHADOW_XINLINE Tensor< Device, 2 > | FlatTo2D (void) const |
| flatten the tensor to 2 dimension, collapse the higher dimensions together More...
|
|
MSHADOW_XINLINE Tensor< Device,
kSubdim > | operator[] (index_t idx) const |
| get a element of dimension - 1 More...
|
|
MSHADOW_XINLINE Tensor< Device,
dimension > | Slice (index_t begin, index_t end) const |
| slice the tensor in highest dimension [begin,end) More...
|
|
Tensor< Device, dimension > & | operator= (real_t s) |
| functions to fit expression template
|
|
template<typename E > |
Tensor< Device, dimension > & | operator= (const expr::Exp< E, expr::type::kMapper > &exp) |
| functions to fit expression template
|
|
template<typename E > |
Tensor< Device, dimension > & | operator= (const expr::Exp< E, expr::type::kComplex > &exp) |
| functions to fit expression template
|
|
Public Member Functions inherited from mshadow::expr::ContainerExp< Tensor< Device, dimension > > |
const TransposeExp< Tensor
< Device, dimension > > | T (void) const |
| transpose of a matrix More...
|
|
Tensor< Device, dimension > & | operator+= (real_t s) |
| operator overload
|
|
Tensor< Device, dimension > & | operator+= (const Exp< E, etype > &exp) |
| implementation of operator+=
|
|
Tensor< Device, dimension > & | operator-= (real_t s) |
| operator overload
|
|
Tensor< Device, dimension > & | operator-= (const Exp< E, etype > &exp) |
| implementation of operator-=
|
|
Tensor< Device, dimension > & | operator*= (real_t s) |
| operator overload
|
|
Tensor< Device, dimension > & | operator*= (const Exp< E, etype > &exp) |
| implementation of operator*=
|
|
Tensor< Device, dimension > & | operator/= (real_t s) |
| operator overload
|
|
Tensor< Device, dimension > & | operator/= (const Exp< E, etype > &exp) |
| implementation of operator/=
|
|
Tensor< Device, dimension > & | __assign (real_t s) |
| operator overload
|
|
Tensor< Device, dimension > & | __assign (const Exp< E, type::kMapper > &exp) |
| implementation of operator=, note that we can not define container = container
|
|
Tensor< Device, dimension > & | __assign (const Exp< E, type::kComplex > &exp) |
| implementation of operator=, note that we can not define container = container
|
|
Public Member Functions inherited from mshadow::expr::Exp< Tensor< Device, dimension >, type::kContainer > |
const Tensor< Device, dimension > & | self (void) const |
|
Tensor< Device, dimension > & | refself (void) |
|
template<typename Device, int dimension>
class mshadow::TensorContainer< Device, dimension >
tensor container that does memory allocation and resize like STL, use it to save the lines of FreeSpace in class. Do not abuse it, efficiency can come from pre-allocation and no re-allocation
- Template Parameters
-
Device | which device the tensor is on |
dimension | dimension of the tensor |