23 #ifndef MXNET_COMMON_STATIC_ARRAY_H_ 24 #define MXNET_COMMON_STATIC_ARRAY_H_ 26 #include <mshadow/base.h> 39 template<
typename T,
int num>
41 static const int kNum = num;
51 for (
int i = 0; i < num; ++i) {
52 this->array_[i] = val;
59 for (
int i = 0; i < num; ++i) {
60 this->array_[i] = sa[i];
75 #endif // MXNET_COMMON_STATIC_ARRAY_H_ T array_[kNum]
Definition: static_array.h:43
MSHADOW_XINLINE StaticArray(const StaticArray< T, num > &sa)
constuctor
Definition: static_array.h:57
namespace of mxnet
Definition: base.h:89
MSHADOW_XINLINE StaticArray(const T &val)
constructor, fill in the array with the input value
Definition: static_array.h:49
static const int kNum
Definition: static_array.h:41
MSHADOW_XINLINE const T & operator[](const index_t idx) const
Definition: static_array.h:68
Static array. This code is borrowed from struct Shape<ndim>, except that users can specify the type o...
Definition: static_array.h:40
mshadow::index_t index_t
index type usually use unsigned
Definition: base.h:95
MSHADOW_XINLINE T & operator[](const index_t idx)
Definition: static_array.h:64
MSHADOW_XINLINE StaticArray(void)
default constructor, do nothing
Definition: static_array.h:46