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, DType initv) |
| constructor More...
|
|
| TensorContainer (const TensorContainer< Device, dimension, DType > &src) |
| copy constructor More...
|
|
| ~TensorContainer (void) MSHADOW_THROW_EXCEPTION |
|
void | Resize (const Shape< dimension > &shape) |
| resize the container to given shape, content is NOT preserved More...
|
|
void | Resize (const Shape< dimension > &shape, DType 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 More...
|
|
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...
|
|
TensorContainer & | operator= (const TensorContainer< Device, dimension, DType > &src) |
| assign operator from TensorContainer More...
|
|
Tensor< Device, dimension, DType > & | operator= (DType s) |
| functions to fit expression template More...
|
|
template<typename E > |
Tensor< Device, dimension, DType > & | operator= (const expr::Exp< E, DType, expr::type::kMapper > &exp) |
| functions to fit expression template More...
|
|
template<typename E > |
Tensor< Device, dimension, DType > & | operator= (const expr::Exp< E, DType, expr::type::kChainer > &exp) |
| functions to fit expression template More...
|
|
template<typename E > |
Tensor< Device, dimension, DType > & | operator= (const expr::Exp< E, DType, expr::type::kComplex > &exp) |
| functions to fit expression template More...
|
|
void | Release (void) |
| Release the llocated space, The TensorContainer is still functionable, but will restart allocating space when Resize is called. More...
|
|
Public Member Functions inherited from mshadow::Tensor< Device, dimension, DType > |
MSHADOW_XINLINE | Tensor (void) |
| default constructor More...
|
|
MSHADOW_XINLINE | Tensor (const Shape< dimension > &shape) |
| constructor from shape More...
|
|
MSHADOW_XINLINE | Tensor (DType *dptr, const Shape< dimension > &shape) |
| constructor from data pointer and shape, without stride More...
|
|
MSHADOW_XINLINE | Tensor (DType *dptr, const Shape< dimension > &shape, Stream< Device > *stream) |
| constructor from data pointer and shape, without stride More...
|
|
MSHADOW_XINLINE | Tensor (DType *dptr, const Shape< dimension > &shape, index_t stride, Stream< Device > *stream) |
| constructor from data pointer and shape More...
|
|
void | set_stream (Stream< Device > *stream) |
| set the stream to do computation of current tensor More...
|
|
MSHADOW_XINLINE index_t | MemSize (void) const |
|
MSHADOW_XINLINE bool | CheckContiguous (void) const |
|
MSHADOW_XINLINE index_t | MSize (void) const |
|
MSHADOW_XINLINE index_t | size (int idx) const |
| return size of i-th dimension, start counting from highest dimension More...
|
|
MSHADOW_XINLINE Tensor< Device, 1, DType > | FlatTo1D (void) const |
| flatten the tensor to 1 dimension More...
|
|
MSHADOW_XINLINE Tensor< Device, 2, DType > | FlatTo2D (void) const |
| flatten the tensor to 2 dimension, collapse the higher dimensions together More...
|
|
MSHADOW_XINLINE Tensor< Device, kSubdim, DType > | operator[] (index_t idx) const |
| get a element of dimension - 1 More...
|
|
MSHADOW_XINLINE Tensor< Device, dimension, DType > | Slice (index_t begin, index_t end) const |
| slice the tensor in highest dimension [begin,end) More...
|
|
Tensor< Device, dimension, DType > & | operator= (const Tensor< Device, dimension, DType > &exp) |
| implement the assignment of same type More...
|
|
Tensor< Device, dimension, DType > & | operator= (const expr::Exp< E, DType, etype > &exp) |
| functions to fit expression template More...
|
|
Tensor< Device, dimension, DType > & | operator= (const DType &exp) |
| functions to fit expression template More...
|
|
Public Member Functions inherited from mshadow::expr::RValueExp< Tensor< Device, dimension, DType >, DType > |
const TransposeExp< Tensor< Device, dimension, DType >, DType > | T (void) const |
| transpose of a matrix More...
|
|
Tensor< Device, dimension, DType > & | operator+= (DType s) |
| operator overload More...
|
|
Tensor< Device, dimension, DType > & | operator+= (const Exp< E, DType, etype > &exp) |
| implementation of operator+= More...
|
|
Tensor< Device, dimension, DType > & | operator-= (DType s) |
| operator overload More...
|
|
Tensor< Device, dimension, DType > & | operator-= (const Exp< E, DType, etype > &exp) |
| implementation of operator-= More...
|
|
Tensor< Device, dimension, DType > & | operator*= (DType s) |
| operator overload More...
|
|
Tensor< Device, dimension, DType > & | operator*= (const Exp< E, DType, etype > &exp) |
| implementation of operator*= More...
|
|
Tensor< Device, dimension, DType > & | operator/= (DType s) |
| operator overload More...
|
|
Tensor< Device, dimension, DType > & | operator/= (const Exp< E, DType, etype > &exp) |
| implementation of operator/= More...
|
|
Tensor< Device, dimension, DType > & | __assign (DType s) |
| operator overload More...
|
|
Tensor< Device, dimension, DType > & | __assign (const Exp< E, DType, etype > &exp) |
| we can not define container = container More...
|
|
Tensor< Device, dimension, DType > & | __assign (const Exp< Tensor< Device, dimension, DType >, DType, type::kRValue > &exp) |
| operator overload, assign More...
|
|
Public Member Functions inherited from mshadow::expr::Exp< Tensor< Device, dimension, DType >, DType, type::kRValue > |
const Tensor< Device, dimension, DType > & | self (void) const |
|
Tensor< Device, dimension, DType > * | ptrself (void) |
|
template<typename Device, int dimension, typename DType = default_real_t>
class mshadow::TensorContainer< Device, dimension, DType >
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 |