mxnet
|
A Shape class that is used to represent shape of each tensor. More...
#include <tuple.h>
Public Member Functions | |
TShape ()=default | |
default constructor More... | |
TShape (uint32_t ndim) | |
TShape (const Tuple< dim_t > &s) | |
copy constructor of TShape More... | |
TShape (std::initializer_list< dim_t > init) | |
constructor from initializer list More... | |
TShape (Tuple< dim_t > &&s) | |
move constructor. More... | |
template<typename RandomAccessIterator > | |
TShape (RandomAccessIterator begin, RandomAccessIterator end) | |
construct the Tuple from content of iterator More... | |
TShape & | operator= (const Tuple< dim_t > &src) |
assignment function from tshape More... | |
TShape & | operator= (Tuple< dim_t > &&src) |
move assignment function from tshape More... | |
size_t | Size () const |
size_t | ProdShape (int dimstart, int dimend) const |
const dim_t * | data () const |
dim_t * | data () |
Public Member Functions inherited from nnvm::Tuple< dim_t > | |
Tuple ()=default | |
default constructor More... | |
Tuple (const Tuple< dim_t > &s) | |
copy constructor from another tuple More... | |
Tuple (std::initializer_list< dim_t > init) | |
constructor from initializer list More... | |
Tuple (std::vector< dim_t > init) | |
constructor from vector More... | |
Tuple (Tuple< dim_t > &&src) | |
move constructor from Tuple More... | |
Tuple (RandomAccessIterator begin, RandomAccessIterator end) | |
construct the Tuple from content of iterator More... | |
~Tuple () | |
destructor More... | |
void | assign (RandomAccessIterator begin, RandomAccessIterator end) |
Assign content to tuple from iterator. More... | |
void | swap (Tuple< dim_t > &other) |
Swap current object with other. More... | |
Tuple< dim_t > & | operator= (const Tuple< dim_t > &src) |
assignment from another tuple. More... | |
Tuple< dim_t > & | operator= (Tuple< dim_t > &&src) |
assignment from rvalue of another tuple. More... | |
Tuple< dim_t > & | operator= (std::initializer_list< dim_t > init) |
assignment from initializer list More... | |
bool | operator== (const Tuple< dim_t > &s) const |
bool | operator!= (const Tuple< dim_t > &s) const |
const dim_t * | begin () const |
dim_t * | begin () |
const dim_t * | end () const |
dim_t * | end () |
uint32_t | ndim () const |
dim_t & | operator[] (size_t i) |
get corresponding index More... | |
const dim_t & | operator[] (size_t i) const |
get corresponding index More... | |
void | Save (dmlc::JSONWriter *writer) const |
Save Tuple to JSON. More... | |
void | Save (TStream *strm) const |
save the content into binary stream More... | |
void | Load (dmlc::JSONReader *reader) |
Load Tuple from JSON. More... | |
bool | Load (TStream *strm) |
load the content from binary stream More... | |
Additional Inherited Members | |
Protected Member Functions inherited from nnvm::Tuple< dim_t > | |
void | SetDim (uint32_t ndim) |
Protected Attributes inherited from nnvm::Tuple< dim_t > | |
uint32_t | ndim_ |
number of dimension of the tuple More... | |
uint32_t | num_heap_allocated_ |
number of cells allocated in data_heap_ More... | |
dim_t | data_stack_ [kStackCache] |
in stack space used to store shape when it is small More... | |
dim_t * | data_heap_ |
space to store shape when dimension is big More... | |
Static Protected Attributes inherited from nnvm::Tuple< dim_t > | |
static const uint32_t | kStackCache |
A Shape class that is used to represent shape of each tensor.
|
default |
default constructor
|
inline |
constructor to construct a shape with all 1.
ndim | the number of dimension |
copy constructor of TShape
s | source shape. |
|
inline |
constructor from initializer list
init | the initializer_list |
|
inline |
construct the Tuple from content of iterator
begin | the beginning of iterator |
end | end the end of the iterator |
RandomAccessIterator | iterator type |
|
inline |
|
inline |
assignment function from tshape
src | source shape. |
move assignment function from tshape
src | source shape. |
|
inline |
dimstart | start dimension |
dimend | end dimension |
|
inline |