25 #ifndef MSHADOW_EXTENSION_FLIP_H_ 26 #define MSHADOW_EXTENSION_FLIP_H_ 28 #include "../extension.h" 39 template<
typename SrcExp,
typename Device,
40 typename DType,
int srcdim>
44 Device, srcdim, DType> {
53 stride_ = shape_[dim];
54 stride_j_ = shape_[srcdim-1];
56 for (
int i = dim + 1; i < srcdim; ++i) {
57 trailing_ *= shape_[i];
60 template<
typename E,
int etype>
82 template<
typename SrcExp,
typename Device,
83 typename DType,
int srcdim>
92 template<
typename SrcExp,
typename Device,
93 typename DType,
int srcdim>
96 Device, DType, srcdim> &t) {
100 template<
typename SrcExp,
typename Device,
101 typename DType,
int srcdim>
109 template<
typename SrcExp,
typename Device,
110 typename DType,
int srcdim>
118 template<
typename SrcExp,
typename Device,
119 typename DType,
int srcdim>
150 #endif // MSHADOW_EXTENSION_FLIP_H_ index_t stride_
Definition: flip.h:47
Tensor RValue, this is the super type of all kinds of possible tensors.
Definition: tensor.h:409
const Container & self(void) const
Definition: expression.h:82
index_t trailing_
Definition: flip.h:46
Definition: expr_engine-inl.h:58
static Stream< Device > * Get(const FlipExp< SrcExp, Device, DType, srcdim > &t)
Definition: flip.h:104
FlipExp< SrcExp, Device, DType, srcdim > flip(const TRValue< SrcExp, Device, srcdim, DType > &src, int dim)
Flip a Tensor.
Definition: flip.h:85
static Shape< dim > Check(const E &t)
FlipExp(const SrcExp &src, int dim)
Definition: flip.h:50
#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
Definition: expr_engine-inl.h:345
MSHADOW_XINLINE DType Eval(index_t i, index_t j) const
Definition: flip.h:125
MSHADOW_XINLINE DType & REval(index_t i, index_t j) const
Definition: flip.h:134
int32_t index_t
type that will be used for index
Definition: base.h:343
const SrcExp & src_
Definition: flip.h:45
index_t shape_[kDimension]
storing the dimension information
Definition: tensor.h:75
runtime shape checking template get the shape of an expression, report error if shape mismatch ...
Definition: expr_engine-inl.h:364
void operator=(const expr::Exp< E, DType, etype > &exp)
Definition: flip.h:62
static Stream< Device > * Get(const E &t)
Plan(const FlipExp< SrcExp, Device, DType, srcdim > &e)
Definition: flip.h:122
void operator=(const DType &exp)
Definition: flip.h:66
defines how expression exp can be evaluated and stored into dst
Definition: expression.h:79
slice expression, slice a tensor's channel
Definition: flip.h:41
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
FlipExp< SrcExp, Device, DType, srcdim > & __assign(DType s)
operator overload
Definition: expression.h:178
Shape< srcdim > shape_
Definition: flip.h:49
static Shape< srcdim > Check(const FlipExp< SrcExp, Device, DType, srcdim > &t)
Definition: flip.h:95
index_t stride_j_
Definition: flip.h:48
computaion stream structure, used for asynchronous computations
Definition: tensor.h:383