mxnet
|
dynamic shape class that can hold shape of arbirary dimension More...
#include <shape.h>
Public Member Functions | |
Shape () | |
constructor More... | |
Shape (const std::vector< index_t > &v) | |
constructor from a vector of index_t More... | |
Shape (index_t s1) | |
constructor one dimmension shape More... | |
Shape (index_t s1, index_t s2) | |
constructor two dimmension shape More... | |
Shape (index_t s1, index_t s2, index_t s3) | |
constructor three dimmension shape More... | |
Shape (index_t s1, index_t s2, index_t s3, index_t s4) | |
constructor four dimmension shape More... | |
Shape (index_t s1, index_t s2, index_t s3, index_t s4, index_t s5) | |
constructor five dimmension shape More... | |
Shape (const Shape &s) | |
constructor from Shape More... | |
~Shape () | |
destructor More... | |
template<typename RandomAccessIterator > | |
void | CopyFrom (RandomAccessIterator begin, RandomAccessIterator end) |
copy shape from content betwen two iterators More... | |
Shape & | operator= (const Shape &shape) |
assignment from shape More... | |
Shape & | operator= (const std::vector< index_t > &shape) |
assignment from vector More... | |
const index_t * | data () const |
index_t * | data () |
index_t | ndim (void) const |
return number of dimension of the tensor inside More... | |
index_t & | operator[] (index_t i) |
get corresponding index More... | |
const index_t & | operator[] (index_t i) const |
get corresponding index More... | |
size_t | Size (void) const |
total number of elements in the tensor More... | |
bool | operator== (const Shape &s) const |
bool | operator!= (const Shape &s) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Shape &shape) |
allow string printing of the shape More... | |
std::istream & | operator>> (std::istream &is, Shape &shape) |
read shape from the istream More... | |
dynamic shape class that can hold shape of arbirary dimension
|
inline |
constructor
|
inlineexplicit |
constructor from a vector of index_t
v | the vector |
|
inlineexplicit |
constructor one dimmension shape
s1 | size of the first dimmension |
constructor two dimmension shape
s1 | size of the first dimmension |
s2 | size of the second dimmension |
constructor three dimmension shape
s1 | size of the first dimmension |
s2 | size of the second dimmension |
s3 | size of the third dimmension |
constructor four dimmension shape
s1 | size of the first dimmension |
s2 | size of the second dimmension |
s3 | size of the third dimmension |
s4 | size of the fourth dimmension |
constructor five dimmension shape
s1 | size of the first dimmension |
s2 | size of the second dimmension |
s3 | size of the third dimmension |
s4 | size of the fourth dimmension |
s5 | size of the fifth dimmension |
|
inline |
constructor from Shape
s | the source shape |
|
inline |
destructor
|
inline |
copy shape from content betwen two iterators
begin | the beginning of iterator |
end | the end of the iterator |
RandomAccessIterator | iterator type |
|
inline |
|
inline |
|
inline |
return number of dimension of the tensor inside
|
inline |
s | the shape to compare against |
assignment from shape
shape | source shape |
assignment from vector
shape | source shape |
|
inline |
s | the shape to compare against |
get corresponding index
i | dimension index |
get corresponding index
i | dimension index |
|
inline |
total number of elements in the tensor
|
friend |
allow string printing of the shape
os | the output stream |
shape | the shape |
|
friend |
read shape from the istream
is | the input stream |
shape | the shape |