26 #ifndef MSHADOW_EXTENSION_FILL_H_ 27 #define MSHADOW_EXTENSION_FILL_H_ 29 #include "../extension.h" 41 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
43 public Exp<MatFillRowElementExp<SrcExp, ValExp, IndexExp, DType>,
44 DType, type::kChainer> {
52 : src_(src), val_(val), index_(index) {}
55 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
56 typename SDType,
typename VDType,
typename IDType,
int e1,
int e2,
int e3>
70 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
81 return static_cast<DType
>(
val_.Eval(0, y));
83 return static_cast<DType
>(
src_.Eval(y, x));
93 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
99 template<
int dim,
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
104 <<
"MatFillRowElementExp only support 2 dimension output";
108 CHECK((shape_src[0] == shape_index[0]) && (shape_index[0] == shape_val[0]))
109 <<
"mat_fill_row_element index length, val length and number of rows in matrix";
114 template<
typename SrcExp,
typename ValExp,
typename IndexExp,
typename DType>
116 static const int kDim = 2;
117 static const int kDevMask =
122 #endif // MSHADOW_EXTENSION_FILL_H_ MatFillRowElementExp(const SrcExp &src, const ValExp &val, const IndexExp &index)
constructor
Definition: fill.h:51
Definition: expr_engine-inl.h:59
used to help static type check
Definition: expr_engine-inl.h:331
const IndexExp & index_
index operand
Definition: fill.h:49
MSHADOW_XINLINE DType Eval(index_t y, index_t x) const
Definition: fill.h:78
static Shape< dim > Check(const E &t)
#define MSHADOW_XINLINE
Definition: base.h:223
static type inference template, used to get the dimension of each expression, if ExpInfo<E>::kDim == ...
Definition: expr_engine-inl.h:263
int32_t index_t
type that will be used for index
Definition: base.h:336
const ValExp & val_
Definition: fill.h:47
Plan(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &e)
Definition: fill.h:73
runtime shape checking template get the shape of an expression, report error if shape mismatch ...
Definition: expr_engine-inl.h:365
const SrcExp & src_
src operand
Definition: fill.h:46
Set value of a specific element in each line of the data matrix.
Definition: fill.h:42
defines how expression exp can be evaluated and stored into dst
Definition: expression.h:80
const SubType & self(void) const
Definition: expression.h:83
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan(const BinaryMapExp< OP, TA, TB, DType, etype > &e)
Definition: expr_engine-inl.h:240
overloaded + operator between half_t and bf16_t
Definition: base.h:327
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:58
static Shape< dim > Check(const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &t)
Definition: fill.h:102