|
| | TShape () |
| | default constructor More...
|
| |
| | TShape (const int ndim, const dim_t value) |
| |
| | 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 , typename std::enable_if< std::is_same< typename std::iterator_traits< RandomAccessIterator >::iterator_category, std::random_access_iterator_tag >::value, int >::type = 0> |
| | TShape (RandomAccessIterator begin, RandomAccessIterator end) |
| | construct the Tuple from content of iterator. This function is enforced with template arguments of random access iterator types. This is necessary to distinguish from another constructor: TShape(const int, const dim_t). More...
|
| |
| | TShape (const ObjectRef &src) |
| |
| 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 () |
| |
| | Tuple ()=default |
| | default constructor More...
|
| |
| | Tuple (const int ndim, const dim_t value) |
| |
| | 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 (const runtime::ObjectRef &src) |
| |
| | ~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 () |
| |
| int | ndim () const |
| |
| dim_t & | operator[] (int i) |
| | get corresponding index More...
|
| |
| const dim_t & | operator[] (int 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...
|
| |
A Shape class that is used to represent shape of each tensor.
The ndim of a valid shape is an integer in range [-1, inf). ndim = -1 means the shape information is unknown and need to be inferred. ndim = 0 means the tensor with the shape is a scalar.
The dimension size of a valid shape is an integer in range [-1, inf). dim_size = -1 means the size of that dimension is unknown and need to be inferred. dim_size = 0 means that dimension is empty.
The definition of ndim = 0 and dim_size = 0 is consistent with NumPy.
template<typename RandomAccessIterator , typename std::enable_if< std::is_same< typename std::iterator_traits< RandomAccessIterator >::iterator_category, std::random_access_iterator_tag >::value, int >::type = 0>
| mxnet::TShape::TShape |
( |
RandomAccessIterator |
begin, |
|
|
RandomAccessIterator |
end |
|
) |
| |
|
inline |
construct the Tuple from content of iterator. This function is enforced with template arguments of random access iterator types. This is necessary to distinguish from another constructor: TShape(const int, const dim_t).
- Parameters
-
| begin | the beginning of iterator |
| end | end the end of the iterator |
- Template Parameters
-
| RandomAccessIterator | iterator type |