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> {
51 : src_(src), val_(val), index_(index) {}
54 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
55 typename SDType,
typename VDType,
typename IDType,
int e1,
int e2,
int e3>
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>
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>
115 static const int kDim = 2;
116 static const int kDevMask =
121 #endif // MSHADOW_EXTENSION_FILL_H_ MatFillRowElementExp(const SrcExp &src, const ValExp &val, const IndexExp &index)
constructor
Definition: fill.h:50
const SubType & self(void) const
Definition: expression.h:82
Definition: expr_engine-inl.h:58
used to help static type check
Definition: expr_engine-inl.h:330
const IndexExp & index_
index operand
Definition: fill.h:48
MSHADOW_XINLINE DType Eval(index_t y, index_t x) const
Definition: fill.h:77
static Shape< dim > Check(const E &t)
#define MSHADOW_XINLINE
Definition: base.h:230
static type inference template, used to get the dimension of each expression, if ExpInfo<E>::kDim == ...
Definition: expr_engine-inl.h:262
int32_t index_t
type that will be used for index
Definition: base.h:343
const ValExp & val_
Definition: fill.h:46
Plan(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &e)
Definition: fill.h:72
runtime shape checking template get the shape of an expression, report error if shape mismatch ...
Definition: expr_engine-inl.h:364
const SrcExp & src_
src operand
Definition: fill.h:45
Set value of a specific element in each line of the data matrix.
Definition: fill.h:41
defines how expression exp can be evaluated and stored into dst
Definition: expression.h:79
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan(const BinaryMapExp< OP, TA, TB, DType, etype > &e)
Definition: expr_engine-inl.h:239
overloaded + operator between half_t and bf16_t
Definition: base.h:334
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
static Shape< dim > Check(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &t)
Definition: fill.h:101