26 #ifndef MSHADOW_EXTENSION_FLIP_H_ 27 #define MSHADOW_EXTENSION_FLIP_H_ 29 #include "../extension.h" 40 template<
typename SrcExp,
typename Device,
41 typename DType,
int srcdim>
45 Device, srcdim, DType> {
54 stride_ = shape_[dim];
55 stride_j_ = shape_[srcdim-1];
57 for (
int i = dim + 1; i < srcdim; ++i) {
58 trailing_ *= shape_[i];
61 template<
typename E,
int etype>
83 template<
typename SrcExp,
typename Device,
84 typename DType,
int srcdim>
93 template<
typename SrcExp,
typename Device,
94 typename DType,
int srcdim>
97 Device, DType, srcdim> &t) {
101 template<
typename SrcExp,
typename Device,
102 typename DType,
int srcdim>
110 template<
typename SrcExp,
typename Device,
111 typename DType,
int srcdim>
119 template<
typename SrcExp,
typename Device,
120 typename DType,
int srcdim>
151 #endif // MSHADOW_EXTENSION_FLIP_H_ index_t stride_
Definition: flip.h:48
MSHADOW_XINLINE DType & REval(index_t i, index_t j) const
Definition: flip.h:135
Tensor RValue, this is the super type of all kinds of possible tensors.
Definition: tensor.h:410
index_t trailing_
Definition: flip.h:47
Definition: expr_engine-inl.h:59
static Stream< Device > * Get(const FlipExp< SrcExp, Device, DType, srcdim > &t)
Definition: flip.h:105
FlipExp< SrcExp, Device, DType, srcdim > flip(const TRValue< SrcExp, Device, srcdim, DType > &src, int dim)
Flip a Tensor.
Definition: flip.h:86
static Shape< dim > Check(const E &t)
FlipExp(const SrcExp &src, int dim)
Definition: flip.h:51
#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
Definition: expr_engine-inl.h:346
int32_t index_t
type that will be used for index
Definition: base.h:336
MSHADOW_XINLINE DType Eval(index_t i, index_t j) const
Definition: flip.h:126
const SrcExp & src_
Definition: flip.h:46
index_t shape_[kDimension]
storing the dimension information
Definition: tensor.h:76
runtime shape checking template get the shape of an expression, report error if shape mismatch ...
Definition: expr_engine-inl.h:365
void operator=(const expr::Exp< E, DType, etype > &exp)
Definition: flip.h:63
static Stream< Device > * Get(const E &t)
Plan(const FlipExp< SrcExp, Device, DType, srcdim > &e)
Definition: flip.h:123
void operator=(const DType &exp)
Definition: flip.h:67
defines how expression exp can be evaluated and stored into dst
Definition: expression.h:80
const Container & self(void) const
Definition: expression.h:83
slice expression, slice a tensor's channel
Definition: flip.h:42
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
FlipExp< SrcExp, Device, DType, srcdim > & __assign(DType s)
operator overload
Definition: expression.h:179
Shape< srcdim > shape_
Definition: flip.h:50
static Shape< srcdim > Check(const FlipExp< SrcExp, Device, DType, srcdim > &t)
Definition: flip.h:96
index_t stride_j_
Definition: flip.h:49
computaion stream structure, used for asynchronous computations
Definition: tensor.h:384