Go to the documentation of this file.
25 #ifndef MSHADOW_EXTENSION_MIRROR_H_
26 #define MSHADOW_EXTENSION_MIRROR_H_
27 #include "../extension.h"
36 template<
typename SrcExp,
typename DType,
int srcdim>
39 SrcExp, srcdim, DType> {
55 template<
typename SrcExp,
typename DType,
int etype>
56 inline MirroringExp<SrcExp, DType, ExpInfo<SrcExp>::kDim>
59 ::Error_Expression_Does_Not_Meet_Dimension_Req();
65 template<
typename SrcExp,
typename DType,
int srcdim>
69 : src_(
MakePlan(e.src_)), width_(e.shape_[srcdim - 1]) {}
71 return src_.Eval(i, width_ - j - 1);
80 #endif // MSHADOW_EXTENSION_MIRROR_H_
const SubType & self(void) const
Definition: expression.h:82
used to help static type check
Definition: expr_engine-inl.h:330
MirroringExp(const SrcExp &src)
constructor
Definition: mirror.h:43
MSHADOW_XINLINE DType Eval(index_t i, index_t j) const
Definition: mirror.h:70
#define MSHADOW_XINLINE
Definition: base.h:228
static Shape< dim > Check(const E &t)
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan(const BinaryMapExp< OP, TA, TB, DType, etype > &e)
Definition: expr_engine-inl.h:239
Shape< dim > shape_
the shape of this expression
Definition: expr_engine-inl.h:47
MirroringExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > mirror(const Exp< SrcExp, DType, etype > &src)
mirroring expression, mirror images in width
Definition: mirror.h:57
int32_t index_t
type that will be used for index
Definition: base.h:328
Definition: expr_engine-inl.h:58
mirror expression, mirror a image in width
Definition: mirror.h:37
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
a general class that allows extension that makes tensors of some shape
Definition: expr_engine-inl.h:43
const SrcExp & src_
source operand
Definition: mirror.h:41
Plan(const MirroringExp< SrcExp, DType, srcdim > &e)
Definition: mirror.h:68