Go to the documentation of this file.
25 #ifndef MSHADOW_EXTENSION_FILL_H_
26 #define MSHADOW_EXTENSION_FILL_H_
28 #include "../extension.h"
40 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
42 public Exp<MatFillRowElementExp<SrcExp, ValExp, IndexExp, DType>,
43 DType, type::kChainer> {
54 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
55 typename SDType,
typename VDType,
typename IDType,
int e1,
int e2,
int e3>
56 inline MatFillRowElementExp<SrcExp, ValExp, IndexExp, SDType>
69 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
80 return static_cast<DType
>(val_.Eval(0, y));
82 return static_cast<DType
>(src_.Eval(y, x));
92 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
93 inline Plan<MatFillRowElementExp<SrcExp, ValExp, IndexExp, DType>, DType>
98 template<
int dim,
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
103 <<
"MatFillRowElementExp only support 2 dimension output";
107 CHECK((shape_src[0] == shape_index[0]) && (shape_index[0] == shape_val[0]))
108 <<
"mat_fill_row_element index length, val length and number of rows in matrix";
113 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
121 #endif // MSHADOW_EXTENSION_FILL_H_
static const int kDevMask
Definition: expr_engine-inl.h:264
const SubType & self(void) const
Definition: expression.h:82
used to help static type check
Definition: expr_engine-inl.h:330
#define MSHADOW_XINLINE
Definition: base.h:228
Set value of a specific element in each line of the data matrix.
Definition: fill.h:41
runtime shape checking template get the shape of an expression, report error if shape mismatch
Definition: expr_engine-inl.h:364
MatFillRowElementExp(const SrcExp &src, const ValExp &val, const IndexExp &index)
constructor
Definition: fill.h:50
static Shape< dim > Check(const E &t)
const SrcExp & src_
src operand
Definition: fill.h:45
static type inference template, used to get the dimension of each expression, if ExpInfo<E>::kDim == ...
Definition: expr_engine-inl.h:262
const ValExp & val_
Definition: fill.h:46
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan(const BinaryMapExp< OP, TA, TB, DType, etype > &e)
Definition: expr_engine-inl.h:239
MSHADOW_XINLINE DType Eval(index_t y, index_t x) const
Definition: fill.h:77
Plan(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &e)
Definition: fill.h:72
static const int kDim
Definition: expr_engine-inl.h:263
int32_t index_t
type that will be used for index
Definition: base.h:328
Definition: expr_engine-inl.h:58
static Shape< dim > Check(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &t)
Definition: fill.h:101
defines how expression exp can be evaluated and stored into dst
Definition: expression.h:79
overloaded + operator between half_t and bf16_t
Definition: base.h:319
MatFillRowElementExp< SrcExp, ValExp, IndexExp, SDType > mat_fill_row_element(const Exp< SrcExp, SDType, e1 > &src, const Exp< ValExp, VDType, e2 > &val, const Exp< IndexExp, IDType, e3 > &index)
Definition: fill.h:57
const IndexExp & index_
index operand
Definition: fill.h:48