mxnet
Namespaces | Classes | Typedefs | Functions
mshadow::expr Namespace Reference

namespace for abstract expressions and expressions template, have no dependency on tensor.h, These data structure takes no charge in computations, they are only used to define operations and represent expression in a symbolic way More...

Namespaces

 type
 type of expressions
 

Classes

struct  BinaryMapExp
 binary map expression lhs [op] rhs More...
 
struct  BLASEngine
 
struct  BLASEngine< cpu, double >
 
struct  BLASEngine< cpu, float >
 
struct  BLASEngine< gpu, double >
 
struct  BLASEngine< gpu, float >
 
struct  BLASEngine< gpu, half::half_t >
 
struct  Broadcast1DExp
 broadcast Tensor1D into a higher dimension Tensor input: Tensor<Device,1>: ishape[0] output: Tensor<Device,dimdst> : oshape[dimcast] = ishape[0] More...
 
struct  BroadcastScalarExp
 broadcast scalar into a higher dimension Tensor input: Tensor<Device,1>: ishape = {1} output: Tensor<Device, dimdst> : oshape[dimcast] = ishape[0] More...
 
struct  BroadcastWithAxisExp
 Broadcasting the tensor in the given axis. If keepdim is off, insert the broadcasting dim after axis. Otherwise broadcasting axis. More...
 
struct  BroadcastWithMultiAxesExp
 Broadcasting the tensor in multiple axes. The dimension of the source tensor in the given axes must be 1. More...
 
struct  ChannelPoolingExp
 channel pooling expression, do reduction over (local nearby) channels, used to implement local response normalization More...
 
struct  ChannelUnpoolingExp
 channel pooling expression, do reduction over (local nearby) channels, used to implement local response normalization More...
 
struct  ComplexBinaryMapExp
 binary map expression lhs [op] rhs where lhs and rhs are complex tensors More...
 
struct  ComplexUnitaryExp
 compute conj(src) where src is a complex tensor More...
 
struct  ConcatExp
 concat expression, concat two tensor's channel More...
 
struct  CroppingExp
 crop expression, cut off the boundary region, reverse operation of padding More...
 
struct  DotEngine
 
struct  DotEngine< SV, xpu, 1, 1, 2, false, transpose_right, DType >
 
struct  DotEngine< SV, xpu, 2, 1, 1, true, false, DType >
 
struct  DotEngine< SV, xpu, 2, 2, 2, transpose_left, transpose_right, DType >
 
struct  DotExp
 matrix multiplication expression dot(lhs[.T], rhs[.T]) More...
 
struct  Exp
 defines how expression exp can be evaluated and stored into dst More...
 
struct  ExpComplexEngine
 some engine that evaluate complex expression More...
 
struct  ExpComplexEngine< SV, Tensor< Device, 1, DType >, ReduceTo1DExp< SrcExp, DType, Reducer, 1 >, DType >
 
struct  ExpComplexEngine< SV, Tensor< Device, 1, DType >, ReduceTo1DExp< SrcExp, DType, Reducer, m_dimkeep >, DType >
 
struct  ExpComplexEngine< SV, Tensor< Device, dim, DType >, DotExp< Tensor< Device, ldim, DType >, Tensor< Device, rdim, DType >, ltrans, rtrans, DType >, DType >
 
struct  ExpEngine
 the engine that dispatches simple operations More...
 
struct  ExpInfo
 static type inference template, used to get the dimension of each expression, if ExpInfo<E>::kDim == -1, this means here are mismatch in expression if (ExpInfo<E>::kDevMask & cpu::kDevMask) != 0, this means this expression can be assigned to cpu More...
 
struct  ExpInfo< BinaryMapExp< OP, TA, TB, DType, etype > >
 
struct  ExpInfo< ComplexBinaryMapExp< calctype, OP, TA, TB, DType, etype > >
 
struct  ExpInfo< ComplexUnitaryExp< calctype, OP, TA, DType, etype > >
 
struct  ExpInfo< ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, dimsrc_m_cat > >
 
struct  ExpInfo< FlipExp< SrcExp, Device, DType, srcdim > >
 
struct  ExpInfo< ImplicitGEMMExp< LhsExp, RhsExp, DType > >
 
struct  ExpInfo< MakeTensorExp< T, SrcExp, dim, DType > >
 
struct  ExpInfo< MaskExp< IndexExp, SrcExp, DType > >
 
struct  ExpInfo< MatChooseRowElementExp< SrcExp, IndexExp, DType > >
 
struct  ExpInfo< MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > >
 
struct  ExpInfo< OneHotEncodeExp< IndexExp, DType > >
 
struct  ExpInfo< RangeExp< DType > >
 
struct  ExpInfo< ScalarExp< DType > >
 
struct  ExpInfo< SliceExExp< SrcExp, Device, DType, srcdim > >
 
struct  ExpInfo< SliceExp< SrcExp, Device, DType, srcdim, dimsrc_m_slice > >
 
struct  ExpInfo< TakeExp< IndexExp, SrcExp, DType > >
 
struct  ExpInfo< TakeGradExp< IndexExp, SrcExp, DType > >
 
struct  ExpInfo< Tensor< Device, dim, DType > >
 
struct  ExpInfo< TernaryMapExp< OP, TA, TB, TC, DType, etype > >
 
struct  ExpInfo< TransposeExp< E, DType > >
 
struct  ExpInfo< TransposeIndicesExp< SrcExp, DType, dimsrc, etype > >
 
struct  ExpInfo< TypecastExp< DstDType, SrcDType, EType, etype > >
 
struct  ExpInfo< UnaryMapExp< OP, TA, DType, etype > >
 
struct  FlipExp
 slice expression, slice a tensor's channel More...
 
struct  ImplicitGEMMExp
 Matrix multiplication. More...
 
struct  MakeTensorExp
 a general class that allows extension that makes tensors of some shape More...
 
struct  MaskExp
 Broadcast a mask and do element-wise multiplication. More...
 
struct  MatChooseRowElementExp
 Make a choice of index in the lowest changing dimension. More...
 
struct  MatFillRowElementExp
 Set value of a specific element in each line of the data matrix. More...
 
struct  MirroringExp
 mirror expression, mirror a image in width More...
 
struct  OneHotEncodeExp
 Create a one-hot indicator array. More...
 
struct  PackColToPatchXExp
 reverse operation of UnpackPatchToCol, used to backprop gradient back this is a version supporting multiple images More...
 
struct  PacketAlignCheck
 
struct  PacketAlignCheck< dim, BinaryMapExp< OP, TA, TB, DType, etype >, Arch >
 
struct  PacketAlignCheck< dim, ScalarExp< DType >, Arch >
 
struct  PacketAlignCheck< dim, Tensor< cpu, dim, DType >, Arch >
 
struct  PacketAlignCheck< dim, UnaryMapExp< OP, TA, DType, etype >, Arch >
 
struct  PacketCheck
 static check packet enable More...
 
struct  PacketCheck< BinaryMapExp< OP, TA, TB, DType, etype >, Arch >
 
struct  PacketCheck< double, Arch >
 
struct  PacketCheck< float, Arch >
 
struct  PacketCheck< ScalarExp< DType >, Arch >
 
struct  PacketCheck< Tensor< cpu, dim, DType >, Arch >
 
struct  PacketCheck< UnaryMapExp< OP, TA, DType, etype >, Arch >
 
class  PacketPlan
 
class  PacketPlan< BinaryMapExp< OP, TA, TB, DType, etype >, DType, Arch >
 
class  PacketPlan< ScalarExp< DType >, DType, Arch >
 
class  PacketPlan< Tensor< Device, dim, DType >, DType, Arch >
 
class  PacketPlan< UnaryMapExp< OP, TA, DType, etype >, DType, Arch >
 
struct  PaddingExp
 padding expression, pad a image with zeros More...
 
class  Plan
 
class  Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType >
 
struct  Plan< Broadcast1DExp< SrcExp, DType, dimdst, 1 >, DType >
 execution plan of Broadcast1DExp More...
 
struct  Plan< Broadcast1DExp< SrcExp, DType, dimdst, dimdst_m_cast >, DType >
 
struct  Plan< BroadcastScalarExp< SrcExp, DType, dimdst >, DType >
 execution plan of Broadcast1DExp More...
 
struct  Plan< BroadcastWithAxisExp< SrcExp, DType, dimsrc, dimdst >, DType >
 
struct  Plan< BroadcastWithMultiAxesExp< SrcExp, DType, dimsrc >, DType >
 
struct  Plan< ChannelPoolingExp< Reducer, SrcExp, DType, srcdim >, DType >
 
struct  Plan< ChannelUnpoolingExp< Reducer, SrcExp, DType, srcdim >, DType >
 
class  Plan< ComplexBinaryMapExp< op::complex::kBinaryCC, OP, TA, TB, DType, etype >, DType >
 
class  Plan< ComplexBinaryMapExp< op::complex::kBinaryCR, OP, TA, TB, DType, etype >, DType >
 
class  Plan< ComplexBinaryMapExp< op::complex::kBinaryRC, OP, TA, TB, DType, etype >, DType >
 
class  Plan< ComplexUnitaryExp< op::complex::kUnitaryC2C, OP, TA, DType, etype >, DType >
 
class  Plan< ComplexUnitaryExp< op::complex::kUnitaryC2R, OP, TA, DType, etype >, DType >
 
class  Plan< ComplexUnitaryExp< op::complex::kUnitaryR2C, OP, TA, DType, etype >, DType >
 
struct  Plan< ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, 1 >, DType >
 
struct  Plan< ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, dimsrc_m_cat >, DType >
 
struct  Plan< CroppingExp< SrcExp, DType, srcdim >, DType >
 
struct  Plan< FlipExp< SrcExp, Device, DType, srcdim >, DType >
 
struct  Plan< ImplicitGEMMExp< LhsExp, RhsExp, DType >, DType >
 
struct  Plan< MakeTensorExp< SubType, SrcExp, dim, DType >, DType >
 
struct  Plan< MaskExp< IndexExp, SrcExp, DType >, DType >
 
struct  Plan< MatChooseRowElementExp< SrcExp, IndexExp, DType >, DType >
 
struct  Plan< MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType >, DType >
 
struct  Plan< MirroringExp< SrcExp, DType, srcdim >, DType >
 
struct  Plan< OneHotEncodeExp< IndexExp, DType >, DType >
 
struct  Plan< PackColToPatchXExp< SrcExp, DType, dstdim >, DType >
 
struct  Plan< PaddingExp< SrcExp, DType, srcdim >, DType >
 
struct  Plan< PoolingExp< Reducer, SrcExp, DType, srcdim >, DType >
 
struct  Plan< RangeExp< DType >, DType >
 
struct  Plan< ReduceWithAxisExp< Reducer, SrcExp, DType, dimsrc, mask, dimdst >, DType >
 
struct  Plan< ReshapeExp< SrcExp, DType, dimdst, 1 >, DType >
 
struct  Plan< ReshapeExp< SrcExp, DType, dimdst, dimsrc >, DType >
 
class  Plan< ScalarExp< DType >, DType >
 
struct  Plan< SliceExExp< SrcExp, Device, DType, srcdim >, DType >
 
struct  Plan< SliceExp< SrcExp, Device, DType, srcdim, 1 >, DType >
 
struct  Plan< SliceExp< SrcExp, Device, DType, srcdim, dimsrc_m_slice >, DType >
 
struct  Plan< SwapAxisExp< SrcExp, DType, dimsrc, 1, a2 >, DType >
 
struct  Plan< SwapAxisExp< SrcExp, DType, dimsrc, m_a1, a2 >, DType >
 
struct  Plan< TakeExp< IndexExp, SrcExp, DType >, DType >
 
struct  Plan< TakeGradExp< IndexExp, SrcExp, DType >, DType >
 
class  Plan< Tensor< Device, 1, DType >, DType >
 
class  Plan< Tensor< Device, dim, DType >, DType >
 
class  Plan< TernaryMapExp< OP, TA, TB, TC, DType, etype >, DType >
 
struct  Plan< TransposeExExp< SrcExp, DType, dimsrc >, DType >
 
class  Plan< TransposeExp< EType, DType >, DType >
 
struct  Plan< TransposeIndicesExp< SrcExp, DType, dimsrc, etype >, DType >
 
class  Plan< TypecastExp< DstDType, SrcDType, EType, etype >, DstDType >
 
class  Plan< UnaryMapExp< OP, TA, DType, etype >, DType >
 
struct  Plan< UnpackPatchToColXExp< SrcExp, DType, srcdim >, DType >
 
struct  Plan< UnPoolingExp< Reducer, SrcExp, DType, srcdim >, DType >
 
struct  Plan< UpSamplingNearestExp< SrcExp, DType, srcdim >, DType >
 
struct  PoolingExp
 pooling expression, do reduction over local patches of a image More...
 
struct  RangeExp
 Generate a range vector similar to python: range(start, stop[, step][, repeat]). If step is positive, the last element is the largest start + i * step less than stop If step is negative, the last element is the smallest start + i * step greater than stop. All elements are repeated for repeat times, e.g range(0, 4, 2, 3) –> 0, 0, 0, 2, 2, 2. More...
 
struct  ReduceTo1DExp
 reduction to 1 dimension tensor input: Tensor<Device,k>: ishape output: Tensor<Device,1> shape[0] = ishape[dimkeep]; More...
 
struct  ReduceWithAxisExp
 reduce out the dimension of src labeled by axis. More...
 
struct  ReshapeExp
 reshape the content to another shape input: Tensor<Device,dimsrc>: ishape output: Tensor<Device,dimdst> ishape.Size() == oshape.Size() More...
 
class  RValueExp
 base class of all rvalues More...
 
struct  ScalarExp
 scalar expression More...
 
struct  ShapeCheck
 runtime shape checking template get the shape of an expression, report error if shape mismatch More...
 
struct  ShapeCheck< dim, BinaryMapExp< OP, TA, TB, DType, etype > >
 
struct  ShapeCheck< dim, ComplexBinaryMapExp< calctype, OP, TA, TB, DType, etype > >
 
struct  ShapeCheck< dim, ComplexUnitaryExp< calctype, OP, TA, DType, etype > >
 
struct  ShapeCheck< dim, ImplicitGEMMExp< LhsExp, RhsExp, DType > >
 
struct  ShapeCheck< dim, MakeTensorExp< T, SrcExp, dim, DType > >
 
struct  ShapeCheck< dim, MaskExp< IndexExp, SrcExp, DType > >
 
struct  ShapeCheck< dim, MatChooseRowElementExp< SrcExp, IndexExp, DType > >
 
struct  ShapeCheck< dim, MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > >
 
struct  ShapeCheck< dim, OneHotEncodeExp< IndexExp, DType > >
 
struct  ShapeCheck< dim, RangeExp< DType > >
 
struct  ShapeCheck< dim, ScalarExp< DType > >
 
struct  ShapeCheck< dim, TakeExp< IndexExp, SrcExp, DType > >
 
struct  ShapeCheck< dim, TakeGradExp< IndexExp, SrcExp, DType > >
 
struct  ShapeCheck< dim, Tensor< Device, dim, DType > >
 
struct  ShapeCheck< dim, TernaryMapExp< OP, TA, TB, TC, DType, etype > >
 
struct  ShapeCheck< dim, TransposeExp< E, DType > >
 
struct  ShapeCheck< dim, TransposeIndicesExp< SrcExp, DType, dimsrc, etype > >
 
struct  ShapeCheck< dim, TypecastExp< DstDType, SrcDType, EType, etype > >
 
struct  ShapeCheck< dim, UnaryMapExp< OP, TA, DType, etype > >
 
struct  ShapeCheck< srcdim, ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, dimsrc_m_cat > >
 
struct  ShapeCheck< srcdim, FlipExp< SrcExp, Device, DType, srcdim > >
 
struct  ShapeCheck< srcdim, SliceExExp< SrcExp, Device, DType, srcdim > >
 
struct  ShapeCheck< srcdim, SliceExp< SrcExp, Device, DType, srcdim, dimsrc_m_slice > >
 
struct  SliceExExp
 slice expression, slice a tensor's channel More...
 
struct  SliceExp
 slice expression, slice a tensor's channel More...
 
struct  StreamInfo
 
struct  StreamInfo< Device, ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, dimsrc_m_cat > >
 
struct  StreamInfo< Device, FlipExp< SrcExp, Device, DType, srcdim > >
 
struct  StreamInfo< Device, SliceExExp< SrcExp, Device, DType, srcdim > >
 
struct  StreamInfo< Device, SliceExp< SrcExp, Device, DType, srcdim, dimsrc_m_slice > >
 
struct  StreamInfo< Device, Tensor< Device, dim, DType > >
 
struct  SwapAxisExp
 swap two axis of a tensor input: Tensor<Device,dim>: ishape output: Tensor<Device,dimdst> oshape[a1],oshape[a2] = ishape[a2],oshape[a1] More...
 
struct  TakeExp
 Take a column from a matrix. More...
 
struct  TakeGradExp
 Calculate embedding gradient. More...
 
struct  TernaryMapExp
 ternary map expression More...
 
struct  TransposeExExp
 transpose axes of a tensor input: Tensor<Device,dim>: ishape output: Tensor<Device,dimdst> oshape[a1],oshape[a2] = ishape[a2],oshape[a1] More...
 
struct  TransposeExp
 represent a transpose expression of a container More...
 
struct  TransposeIndicesExp
 transform contiguous indices of the source tensor to indices of the transposed tensor. input: Tensor<Device, k>: ishape output: Tensor<Device, k>: oshape = ishape More...
 
struct  TypecastExp
 typecast expression, cast the type of elements More...
 
struct  TypeCheck
 template to do type check More...
 
struct  TypeCheckPass
 used to help static type check More...
 
struct  TypeCheckPass< false >
 
struct  TypeCheckPass< true >
 
struct  UnaryMapExp
 unary map expression op(src) More...
 
struct  UnpackPatchToColXExp
 unpack local (overlap) patches of image to column of mat, can be used to implement convolution, this expression allow unpack of a batch this is a version support unpacking multiple images after getting unpacked mat, we can use: output = dot(weight, mat) to get covolved results, the relations: More...
 
struct  UnPoolingExp
 unpooling expr reverse operation of pooling, used to pass gradient back More...
 
struct  UpSamplingNearestExp
 nearest neighboor upsampling out(x, y) = in(int(x / scale_x), int(y / scale_y)) More...
 

Typedefs

typedef packet::PacketArch PacketArch
 

Functions

Shape< 2 > GetShape (const Shape< 2 > &shape, bool transpose)
 
template<typename OP , typename TA , typename TB , typename DType , int etype>
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan (const BinaryMapExp< OP, TA, TB, DType, etype > &e)
 
template<typename OP , typename TA , typename TB , typename TC , typename DType , int etype>
Plan< TernaryMapExp< OP, TA, TB, TC, DType, etype >, DType > MakePlan (const TernaryMapExp< OP, TA, TB, TC, DType, etype > &e)
 
template<typename DType >
Plan< ScalarExp< DType >, DType > MakePlan (const ScalarExp< DType > &e)
 
template<typename DstDType , typename SrcDType , typename EType , int etype>
Plan< TypecastExp< DstDType, SrcDType, EType, etype >, DstDType > MakePlan (const TypecastExp< DstDType, SrcDType, EType, etype > &e)
 
template<typename T , typename DType >
Plan< T, DType > MakePlan (const RValueExp< T, DType > &e)
 
template<typename T , typename DType >
Plan< TransposeExp< T, DType >, DType > MakePlan (const TransposeExp< T, DType > &e)
 
template<typename T , typename SrcExp , int dim, typename DType >
Plan< T, DType > MakePlan (const MakeTensorExp< T, SrcExp, dim, DType > &e)
 
template<typename OP , typename TA , typename DType , int etype>
Plan< UnaryMapExp< OP, TA, DType, etype >, DType > MakePlan (const UnaryMapExp< OP, TA, DType, etype > &e)
 
template<typename TA , typename TB , bool ltrans, bool rtrans>
DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_operator* (const DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_ > &lhs, MSHADOW_SCALAR_ rhs)
 dot operator def More...
 
template<typename TA , typename TB , bool ltrans, bool rtrans>
DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_operator* (MSHADOW_SCALAR_ lhs, const DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_ > &rhs)
 scale of dot operation More...
 
template<typename E , typename DType , typename R , int d>
ReduceTo1DExp< E, DType, R, d > operator* (const ReduceTo1DExp< E, DType, R, d > &e, MSHADOW_SCALAR_ scale)
 operator overload More...
 
template<typename E , typename DType , typename R , int d>
ReduceTo1DExp< E, DType, R, d > operator* (MSHADOW_SCALAR_ scale, const ReduceTo1DExp< E, DType, R, d > &e)
 operator overload More...
 
template<typename OP , typename TA , int ta>
BinaryMapExp< OP, TA, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(ta|type::kMapper)> F (const Exp< TA, MSHADOW_SCALAR_, ta > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload for const More...
 
template<typename OP , typename TB , int tb>
BinaryMapExp< OP, ScalarExp< MSHADOW_SCALAR_ >, TB, MSHADOW_SCALAR_,(tb|type::kMapper)> F (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const Exp< TB, MSHADOW_SCALAR_, tb > &rhs)
 operator overload for const More...
 
template<typename OP >
BinaryMapExp< OP, ScalarExp< MSHADOW_SCALAR_ >, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(1|type::kMapper)> F (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload for const More...
 
template<typename TA , int ta>
BinaryMapExp< op::plus, TA, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(ta|type::kMapper)> operator+ (const Exp< TA, MSHADOW_SCALAR_, ta > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
template<typename TA , int ta>
BinaryMapExp< op::minus, TA, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(ta|type::kMapper)> operator- (const Exp< TA, MSHADOW_SCALAR_, ta > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
template<typename TA , int ta>
BinaryMapExp< op::mul, TA, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(ta|type::kMapper)> operator* (const Exp< TA, MSHADOW_SCALAR_, ta > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
template<typename TA , int ta>
BinaryMapExp< op::div, TA, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(ta|type::kMapper)> operator/ (const Exp< TA, MSHADOW_SCALAR_, ta > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
template<typename TB , int tb>
BinaryMapExp< op::plus, ScalarExp< MSHADOW_SCALAR_ >, TB, MSHADOW_SCALAR_,(tb|type::kMapper)> operator+ (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const Exp< TB, MSHADOW_SCALAR_, tb > &rhs)
 operator overload More...
 
template<typename TB , int tb>
BinaryMapExp< op::minus, ScalarExp< MSHADOW_SCALAR_ >, TB, MSHADOW_SCALAR_,(tb|type::kMapper)> operator- (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const Exp< TB, MSHADOW_SCALAR_, tb > &rhs)
 operator overload More...
 
template<typename TB , int tb>
BinaryMapExp< op::mul, ScalarExp< MSHADOW_SCALAR_ >, TB, MSHADOW_SCALAR_,(tb|type::kMapper)> operator* (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const Exp< TB, MSHADOW_SCALAR_, tb > &rhs)
 operator overload More...
 
template<typename TB , int tb>
BinaryMapExp< op::div, ScalarExp< MSHADOW_SCALAR_ >, TB, MSHADOW_SCALAR_,(tb|type::kMapper)> operator/ (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const Exp< TB, MSHADOW_SCALAR_, tb > &rhs)
 operator overload More...
 
BinaryMapExp< op::plus, ScalarExp< MSHADOW_SCALAR_ >, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(1|type::kMapper)> operator+ (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
BinaryMapExp< op::minus, ScalarExp< MSHADOW_SCALAR_ >, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(1|type::kMapper)> operator- (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
BinaryMapExp< op::mul, ScalarExp< MSHADOW_SCALAR_ >, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(1|type::kMapper)> operator* (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
BinaryMapExp< op::div, ScalarExp< MSHADOW_SCALAR_ >, ScalarExp< MSHADOW_SCALAR_ >, MSHADOW_SCALAR_,(1|type::kMapper)> operator/ (const ScalarExp< MSHADOW_SCALAR_ > &lhs, const ScalarExp< MSHADOW_SCALAR_ > &rhs)
 operator overload More...
 
template<typename DType >
ScalarExp< DType > scalar (DType s)
 create an scalar expression More...
 
template<typename DstDType , typename SrcDType , typename EType , int etype>
TypecastExp< DstDType, SrcDType, EType,(etype|type::kMapper)> tcast (const Exp< EType, SrcDType, etype > &exp)
 create an scalar expression More...
 
template<typename TA , typename TB , typename DType >
DotExp< TA, TB, false, false, DType > dot (const RValueExp< TA, DType > &lhs, const RValueExp< TB, DType > &rhs)
 dot operator def More...
 
template<typename TA , typename TB , typename DType >
DotExp< TA, TB, true, false, DType > dot (const TransposeExp< TA, DType > &lhs, const RValueExp< TB, DType > &rhs)
 dot operator def More...
 
template<typename TA , typename TB , typename DType >
DotExp< TA, TB, false, true, DType > dot (const RValueExp< TA, DType > &lhs, const TransposeExp< TB, DType > &rhs)
 dot operator def More...
 
template<typename TA , typename TB , typename DType >
DotExp< TA, TB, true, true, DType > dot (const TransposeExp< TA, DType > &lhs, const TransposeExp< TB, DType > &rhs)
 dot operator def More...
 
template<bool transpose_left, bool transpose_right, typename TA , typename TB , typename DType >
DotExp< TA, TB, transpose_left, transpose_right, DType > batch_dot (const RValueExp< TA, DType > &lhs, const RValueExp< TB, DType > &rhs)
 batch_dot operator def More...
 
template<typename OP , typename TA , typename TB , typename TC , typename DType , int ta, int tb, int tc>
TernaryMapExp< OP, TA, TB, TC, DType,(ta|tb|tc|type::kMapper)> MakeExp (const Exp< TA, DType, ta > &item1, const Exp< TB, DType, tb > &item2, const Exp< TC, DType, tc > &item3)
 make expression More...
 
template<typename OP , typename TA , typename TB , typename TC , typename DType , int ta, int tb, int tc>
TernaryMapExp< OP, TA, TB, TC, DType,(ta|tb|tc|type::kMapper)> F (const Exp< TA, DType, ta > &item1, const Exp< TB, DType, tb > &item2, const Exp< TC, DType, tc > &item3)
 short hand for MakeExp, usage F<op>(item1,item2,item3). create a ternary operation expression More...
 
template<typename OP , typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< OP, TA, TB, DType,(ta|tb|type::kMapper)> MakeExp (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 make expression More...
 
template<typename OP , typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< OP, TA, TB, DType,(ta|tb|type::kMapper)> F (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 short hand for MakeExp, usage F<op>(lhs, rhs). create a binary operation expression More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< op::plus, TA, TB, DType,(ta|tb|type::kMapper)> operator+ (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 operator overload More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< op::minus, TA, TB, DType,(ta|tb|type::kMapper)> operator- (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 operator overload More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< op::mul, TA, TB, DType,(ta|tb|type::kMapper)> operator* (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 operator overload More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp< op::div, TA, TB, DType,(ta|tb|type::kMapper)> operator/ (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 operator overload More...
 
template<typename OP , typename TA , typename DType , int ta>
UnaryMapExp< OP, TA, DType,(ta|type::kMapper)> MakeExp (const Exp< TA, DType, ta > &src)
 make expression More...
 
template<typename OP , typename TA , typename DType , int ta>
UnaryMapExp< OP, TA, DType,(ta|type::kMapper)> F (const Exp< TA, DType, ta > &src)
 short hand for MakeExp, usage F<op>(src), create a unary operation expression More...
 
template<int dimcast, typename SrcExp , typename DType , int etype, int dimdst>
Broadcast1DExp< SrcExp, DType, dimdst, dimdst-dimcast > broadcast (const expr::Exp< SrcExp, DType, etype > &src, Shape< dimdst > shape)
 a expression that replicate a 1 dimension tensor in dimension dimcast More...
 
template<typename SrcExp , typename DType , int etype, int dimdst>
BroadcastScalarExp< SrcExp, DType, dimdst > broadcast_scalar (const expr::Exp< SrcExp, DType, etype > &src, Shape< dimdst > shape)
 a expression that replicate a scalar tensor to target dimension. More...
 
template<typename SrcExp , typename DType , int etype>
Broadcast1DExp< SrcExp, DType, 2, 1 > repmat (const expr::Exp< SrcExp, DType, etype > &src, index_t nrow)
 a expression that replicate a 1 dimension tensor for nrow times More...
 
template<typename SrcExp , typename DType , int etype>
BroadcastWithAxisExp< SrcExp, DType, ExpInfo< SrcExp >::kDim, ExpInfo< SrcExp >::kDim+1 > broadcast_with_axis (const Exp< SrcExp, DType, etype > &src, const int axis, const index_t size)
 Broadcasting the tensor after given axis. More...
 
template<typename SrcExp , typename DType , int etype>
BroadcastWithAxisExp< SrcExp, DType, ExpInfo< SrcExp >::kDim, ExpInfo< SrcExp >::kDim > broadcast_keepdim (const Exp< SrcExp, DType, etype > &src, const int axis, const index_t size)
 Broadcasting the tensor in the given axis (keepdim turned on) More...
 
template<typename SrcExp , typename DType , int etype, typename TShape >
BroadcastWithMultiAxesExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > broadcast_multi_axes (const Exp< SrcExp, DType, etype > &src, const TShape &axes, const TShape &sizes)
 Broadcasting the tensor in the given axis (keepdim turned on) More...
 
template<typename SrcExp , typename DType , int etype, typename TShape >
BroadcastWithMultiAxesExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > broadcast_to (const Exp< SrcExp, DType, etype > &src, const TShape &target_shape)
 Broadcasting the tensor to the target shape, dimension of different sizes must be 1 in the original tensor. More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelPoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > chpool (const Exp< SrcExp, DType, etype > &src, index_t nsize)
 channel pooling, do reduction over (local nearby) channels, used to implement local response normalization More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelPoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > chpool (const Exp< SrcExp, DType, etype > &src, index_t nsize, index_t stride, index_t pad)
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelUnpoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > ch_unpool (const Exp< SrcExp, DType, etype > &data_src, const Exp< SrcExp, DType, etype > &data_pooled, const Exp< SrcExp, DType, etype > &grad_pooled, index_t nsize, index_t stride, index_t pad)
 channel unpooling, do unroll over (local nearby) channels More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelUnpoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > ch_unpool (const Exp< SrcExp, DType, etype > &data_src, const Exp< SrcExp, DType, etype > &data_pooled, const Exp< SrcExp, DType, etype > &grad_pooled, index_t nsize)
 
template<typename SrcExp , typename IndexExp , typename DType , typename IDType , int e1, int e2>
MatChooseRowElementExp< SrcExp, IndexExp, DType > mat_choose_row_element (const Exp< SrcExp, DType, e1 > &src, const Exp< IndexExp, IDType, e2 > &index)
 
template<typename SrcExp , typename IndexExp , typename DType >
Plan< MatChooseRowElementExp< SrcExp, IndexExp, DType >, DType > MakePlan (const MatChooseRowElementExp< SrcExp, IndexExp, DType > &exp)
 
template<int calctype, typename OP , typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< calctype, OP, TA, TB, DType,(ta|tb|type::kMapper)> ComplexF (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 
template<int calctype, typename OP , typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< calctype, OP, SrcExp, DType,(e1|type::kMapper)> ComplexF (const Exp< SrcExp, DType, e1 > &src)
 conj Negation the imaginary part of A where A is a complex tensor More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryCC, op::complex::mul, TA, TB, DType,(ta|tb|type::kMapper)> complex_mul_cc (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_cc Complex multipilication two complex tensors, A * B More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryCR, op::complex::mul, TA, TB, DType,(ta|tb|type::kMapper)> complex_mul_cr (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_cr Complex multipilication a complex tensor A and a real tensor B More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryRC, op::complex::mul, TA, TB, DType,(ta|tb|type::kMapper)> complex_mul_rc (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_rc Complex multipilication of a real tensor B and a complex tensor A More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryCC, op::complex::div, TA, TB, DType,(ta|tb|type::kMapper)> complex_div_cc (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_cc Complex multipilication two complex tensors, A * B More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryCR, op::complex::div, TA, TB, DType,(ta|tb|type::kMapper)> complex_div_cr (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_cr Complex multipilication a complex tensor A and a real tensor B More...
 
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp< op::complex::kBinaryRC, op::complex::div, TA, TB, DType,(ta|tb|type::kMapper)> complex_div_rc (const Exp< TA, DType, ta > &lhs, const Exp< TB, DType, tb > &rhs)
 complex_mul_rc Complex multipilication of a real tensor A and a complex tensor B More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryC2C, op::complex::conjugate, SrcExp, DType,(e1|type::kMapper)> conj (const Exp< SrcExp, DType, e1 > &src)
 conj Negation the imaginary part of A where A is a complex tensor More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryC2C, op::complex::exchange, SrcExp, DType,(e1|type::kMapper)> complex_exchange (const Exp< SrcExp, DType, e1 > &src)
 complex_exchange Exchange the real and imaginary part of A where A is a complex tensor More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryR2C, op::complex::pad_imag, SrcExp, DType,(e1|type::kMapper)> complex_pad_imag (const Exp< SrcExp, DType, e1 > &src)
 complex_pad_imag Transform real matrix into complex matrix More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryC2R, op::complex::toreal, SrcExp, DType,(e1|type::kMapper)> complex_toreal (const Exp< SrcExp, DType, e1 > &src)
 complex_toreal convert complex matrix to real matrix, keep only real part More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryC2R, op::complex::abs_square, SrcExp, DType,(e1|type::kMapper)> complex_abs_square (const Exp< SrcExp, DType, e1 > &src)
 complex_abs_square calculate the square of the modulus of A where A is a complex tensor More...
 
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp< op::complex::kUnitaryC2R, op::complex::sum_real_imag, SrcExp, DType,(e1|type::kMapper)> complex_sum_real_imag (const Exp< SrcExp, DType, e1 > &src)
 
template<int calctype, typename OP , typename TA , typename TB , typename DType , int etype>
Plan< ComplexBinaryMapExp< calctype, OP, TA, TB, DType, etype >, DType > MakePlan (const ComplexBinaryMapExp< calctype, OP, TA, TB, DType, etype > &e)
 
template<int calctype, typename OP , typename TA , typename DType , int etype>
Plan< ComplexUnitaryExp< calctype, OP, TA, DType, etype >, DType > MakePlan (const ComplexUnitaryExp< calctype, OP, TA, DType, etype > &e)
 
template<int cdim, typename LhsExp , typename RhsExp , typename Device , typename DType , int srcdim>
ConcatExp< LhsExp, RhsExp, Device, DType, srcdim, srcdim-cdim > concat (const TRValue< LhsExp, Device, srcdim, DType > &src1, const TRValue< RhsExp, Device, srcdim, DType > &src2)
 concat two 4D tensor More...
 
template<typename SrcExp , typename DType , int etype>
CroppingExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > crop (const Exp< SrcExp, DType, etype > &src, Shape< 2 > oshape)
 revserse operationg of padding, cut off boundaries, crop output from center of input More...
 
template<typename SrcExp , typename DType , int etype>
CroppingExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > crop (const Exp< SrcExp, DType, etype > &src, Shape< 2 > oshape, index_t start_height, index_t start_width)
 same as crop, but can specify starting position to do cropping More...
 
template<typename SrcExp , typename ValExp , typename IndexExp , typename SDType , typename VDType , typename IDType , int e1, int e2, int e3>
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)
 
template<typename SrcExp , typename ValExp , typename IndexExp , typename DType >
Plan< MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType >, DType > MakePlan (const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &exp)
 
template<typename SrcExp , typename Device , typename DType , int srcdim>
FlipExp< SrcExp, Device, DType, srcdim > flip (const TRValue< SrcExp, Device, srcdim, DType > &src, int dim)
 Flip a Tensor. More...
 
template<typename LhsExp , typename RhsExp , typename DType , int e1, int e2>
ImplicitGEMMExp< LhsExp, RhsExp, DType > implicit_dot (const Exp< LhsExp, DType, e1 > &lhs, const Exp< RhsExp, DType, e2 > &rhs)
 
template<typename LhsExp , typename RhsExp , typename DType >
Plan< ImplicitGEMMExp< LhsExp, RhsExp, DType >, DType > MakePlan (const ImplicitGEMMExp< LhsExp, RhsExp, DType > &exp)
 
template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
MaskExp< IndexExp, SrcExp, DType > mask (const Exp< IndexExp, DType, e1 > &index, const Exp< SrcExp, DType, e2 > &src)
 
template<typename IndexExp , typename SrcExp , typename DType >
Plan< MaskExp< IndexExp, SrcExp, DType >, DType > MakePlan (const MaskExp< IndexExp, SrcExp, DType > &exp)
 
template<typename SrcExp , typename DType , int etype>
MirroringExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > mirror (const Exp< SrcExp, DType, etype > &src)
 mirroring expression, mirror images in width More...
 
template<typename IndexExp , typename IDType , int e1>
OneHotEncodeExp< IndexExp, default_real_tone_hot_encode (const Exp< IndexExp, IDType, e1 > &index, index_t num_choices)
 
template<typename IndexExp , typename DType >
Plan< OneHotEncodeExp< IndexExp, DType >, DType > MakePlan (const OneHotEncodeExp< IndexExp, DType > &exp)
 
template<typename SrcExp , typename DType , int dstdim, int etype>
PackColToPatchXExp< SrcExp, DType, dstdim > pack_col2patch (const expr::Exp< SrcExp, DType, etype > &src, Shape< dstdim > imshape, index_t psize_y, index_t psize_x, index_t pstride, index_t pdilate)
 reverse operation of pack_col2patch, can be used to implement deconvolution More...
 
template<typename SrcExp , typename DType , int dstdim, int etype>
PackColToPatchXExp< SrcExp, DType, dstdim > pack_col2patch (const expr::Exp< SrcExp, DType, etype > &src, Shape< dstdim > imshape, index_t psize_y, index_t psize_x, index_t pstride_y, index_t pstride_x, index_t pdilate_y, index_t pdilate_x)
 
template<typename SrcExp , typename DType , int etype>
PaddingExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > pad (const Exp< SrcExp, DType, etype > &src, index_t pad)
 padding expression, pad a image with zeros on boundaries, padding affects shape[0], and shape[1] More...
 
template<typename SrcExp , typename DType , int etype>
PaddingExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > pad (const Exp< SrcExp, DType, etype > &src, index_t pad_y, index_t pad_x)
 padding expression, pad a image with zeros on boundaries, padding affects shape[0], and shape[1] More...
 
template<typename DType >
RangeExp< DType > range (DType start, DType stop, DType step=1, int repeat=1)
 
template<typename DType >
Plan< RangeExp< DType >, DType > MakePlan (const RangeExp< DType > &exp)
 
template<typename DType >
int RangeOutSize (DType start, DType stop, DType step, int repeat)
 
template<>
int RangeOutSize< float > (float start, float stop, float step, int repeat)
 
template<>
int RangeOutSize< double > (double start, double stop, double step, int repeat)
 
template<typename Reducer , bool mask, typename SrcExp , typename DType , int etype>
ReduceWithAxisExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim, mask, ExpInfo< SrcExp >::kDim-1 > reduce_with_axis (const Exp< SrcExp, DType, etype > &src, int axis)
 reduce out the dimension of src labeled by axis. More...
 
template<typename Reducer , bool mask, typename SrcExp , typename DType , int etype>
ReduceWithAxisExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim, mask, ExpInfo< SrcExp >::kDim > reduce_keepdim (const Exp< SrcExp, DType, etype > &src, int axis)
 reduce out the dimension of src labeled by axis, keepdim turned on. More...
 
template<int dimkeep, typename SrcExp , typename DType , int etype>
ReduceTo1DExp< SrcExp, DType, red::sum, ExpInfo< SrcExp >::kDim-dimkeep > sumall_except_dim (const Exp< SrcExp, DType, etype > &exp)
 a sum over all dimensions, except dimkeep More...
 
template<int dimkeep, typename Reducer , typename SrcExp , typename DType , int etype>
ReduceTo1DExp< SrcExp, DType, Reducer, ExpInfo< SrcExp >::kDim-dimkeep > reduce_except_dim (const Exp< SrcExp, DType, etype > &exp)
 reduce over all dimensions, except dimkeep More...
 
template<typename SrcExp , typename DType , int etype>
ReduceTo1DExp< SrcExp, DType, red::sum, 1 > sum_rows (const Exp< SrcExp, DType, etype > &exp)
 a expression that sum over rows of a matrix More...
 
template<typename SrcExp , typename DType , int etype, int dimdst>
ReshapeExp< SrcExp, DType, dimdst, ExpInfo< SrcExp >::kDim > reshape (const Exp< SrcExp, DType, etype > &src, Shape< dimdst > oshape)
 a expression that reshapes a tensor to another shape More...
 
template<int sdim, typename SrcExp , typename Device , typename DType , int srcdim>
SliceExp< SrcExp, Device, DType, srcdim, srcdim-sdim > slice (const TRValue< SrcExp, Device, srcdim, DType > &src, index_t begin, index_t end)
 Slice a Tensor. More...
 
template<typename SrcExp , typename Device , typename DType , int srcdim>
SliceExExp< SrcExp, Device, DType, srcdim > slice (const TRValue< SrcExp, Device, srcdim, DType > &src, Shape< srcdim > begin, Shape< srcdim > end)
 SliceEx a Tensor. More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
PoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > pool (const Exp< SrcExp, DType, etype > &src, index_t ksize_y, index_t ksize_x, index_t kstride_y, index_t kstride_x)
 pooling subregion results together More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
PoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > pool (const Exp< SrcExp, DType, etype > &src, Shape< 2 > pshape, index_t ksize_y, index_t ksize_x, index_t kstride_y, index_t kstride_x)
 same as pool, except the output shape is specified by pshape More...
 
template<typename Reducer , typename SrcExp , typename DType , int etype>
UnPoolingExp< Reducer, SrcExp, DType, ExpInfo< SrcExp >::kDim > unpool (const Exp< SrcExp, DType, etype > &data_src, const Exp< SrcExp, DType, etype > &data_pooled, const Exp< SrcExp, DType, etype > &grad_pooled, index_t ksize_y, index_t ksize_x, index_t kstride_y, index_t kstride_x)
 unpooling gradient for 4D, backprop gradient value back, revserse operation of pooling, same as unpooling, but allows unequal size of kernel More...
 
template<typename SrcExp , typename DType , int etype>
UpSamplingNearestExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > upsampling_nearest (const Exp< SrcExp, DType, etype > &src, index_t scale)
 
template<int a1, int a2, typename SrcExp , typename DType , int etype>
SwapAxisExp< SrcExp, DType, ExpInfo< SrcExp >::kDim, ExpInfo< SrcExp >::kDim-a1, a2 > swapaxis (const Exp< SrcExp, DType, etype > &src)
 a expression that reshapes a tensor to another shape More...
 
template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
TakeExp< IndexExp, SrcExp, DType > take (const Exp< IndexExp, DType, e1 > &index, const Exp< SrcExp, DType, e2 > &src)
 
template<typename IndexExp , typename SrcExp , typename DType >
Plan< TakeExp< IndexExp, SrcExp, DType >, DType > MakePlan (const TakeExp< IndexExp, SrcExp, DType > &exp)
 
template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
TakeGradExp< IndexExp, SrcExp, DType > take_grad (const Exp< IndexExp, DType, e1 > &index, const Exp< SrcExp, DType, e2 > &src, const index_t input_dim)
 
template<typename IndexExp , typename SrcExp , typename DType >
Plan< TakeGradExp< IndexExp, SrcExp, DType >, DType > MakePlan (const TakeGradExp< IndexExp, SrcExp, DType > &exp)
 
template<typename SrcExp , typename DType , int etype>
TransposeExExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > transpose (const Exp< SrcExp, DType, etype > &src, Shape< ExpInfo< SrcExp >::kDim > axes)
 a expression that reshapes a tensor to another shape More...
 
template<typename SrcExp , typename DType , int dimsrc, int etype>
TransposeIndicesExp< SrcExp, DType, dimsrc, etype > transpose_indices (const Exp< SrcExp, DType, etype > &src_indices, Shape< dimsrc > src_shape, Shape< dimsrc > axes)
 a expression that reshapes a tensor to another shape More...
 
template<typename SrcExp , typename DType , int dimsrc, int etype>
Plan< TransposeIndicesExp< SrcExp, DType, dimsrc, etype >, DType > MakePlan (const TransposeIndicesExp< SrcExp, DType, dimsrc, etype > &e)
 make expression More...
 
template<typename SrcExp , typename DType , int etype>
UnpackPatchToColXExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > unpack_patch2col (const Exp< SrcExp, DType, etype > &img, index_t psize_y, index_t psize_x, index_t pstride, index_t pdilate)
 unpack local (overlap) patches of image to column of mat, can be used to implement convolution after getting unpacked mat, we can use: output = dot(weight, mat) to get covolved results, the relations: More...
 
template<typename SrcExp , typename DType , int etype>
UnpackPatchToColXExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > unpack_patch2col (const Exp< SrcExp, DType, etype > &img, index_t psize_y, index_t psize_x, index_t pstride_y_, index_t pstride_x_, index_t pdilate_y_, index_t pdilate_x_)
 
template<PacketArch Arch, typename OP , typename TA , typename TB , typename DType , int etype>
PacketPlan< BinaryMapExp< OP, TA, TB, DType, etype >, DType, Arch > MakePacketPlan (const BinaryMapExp< OP, TA, TB, DType, etype > &e)
 
template<PacketArch Arch, typename DType >
PacketPlan< ScalarExp< DType >, DType, Arch > MakePacketPlan (const ScalarExp< DType > &e)
 
template<PacketArch Arch, typename T , typename DType >
PacketPlan< T, DType, Arch > MakePacketPlan (const RValueExp< T, DType > &e)
 
template<PacketArch Arch, typename T , int dim, typename DType >
PacketPlan< T, DType, Arch > MakePacketPlan (const MakeTensorExp< T, cpu, dim, DType > &e)
 
template<PacketArch Arch, typename OP , typename TA , typename DType , int etype>
PacketPlan< UnaryMapExp< OP, TA, DType, etype >, DType, Arch > MakePacketPlan (const UnaryMapExp< OP, TA, DType, etype > &e)
 
template<typename SV , typename E , int dim, typename DType , PacketArch Arch>
void MapPacketPlan (Tensor< cpu, dim, DType > _dst, const expr::PacketPlan< E, DType, Arch > &plan)
 use PacketPlan to compute result More...
 

Detailed Description

namespace for abstract expressions and expressions template, have no dependency on tensor.h, These data structure takes no charge in computations, they are only used to define operations and represent expression in a symbolic way

Typedef Documentation

Function Documentation

template<bool transpose_left, bool transpose_right, typename TA , typename TB , typename DType >
DotExp<TA, TB, transpose_left, transpose_right, DType> mshadow::expr::batch_dot ( const RValueExp< TA, DType > &  lhs,
const RValueExp< TB, DType > &  rhs 
)
inline

batch_dot operator def

template<int dimcast, typename SrcExp , typename DType , int etype, int dimdst>
Broadcast1DExp<SrcExp, DType, dimdst, dimdst - dimcast> mshadow::expr::broadcast ( const expr::Exp< SrcExp, DType, etype > &  src,
Shape< dimdst >  shape 
)
inline

a expression that replicate a 1 dimension tensor in dimension dimcast

Parameters
srcTensor<Device,1>: shape[0]
shapeshape of output
Returns
a expresion with type Tensor<Device,dimdst>
Template Parameters
dimcasttarget dimension where the 1D tensor will be broadcasted
SrcExptype of input expression
DTypethe type of elements
dimdstdimension of destination tensor
dimcast_lowestthe dimension we want to cast the data into
template<typename SrcExp , typename DType , int etype>
BroadcastWithAxisExp<SrcExp, DType, ExpInfo<SrcExp>::kDim, ExpInfo<SrcExp>::kDim> mshadow::expr::broadcast_keepdim ( const Exp< SrcExp, DType, etype > &  src,
const int  axis,
const index_t  size 
)
inline

Broadcasting the tensor in the given axis (keepdim turned on)

Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
template<typename SrcExp , typename DType , int etype, typename TShape >
BroadcastWithMultiAxesExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::broadcast_multi_axes ( const Exp< SrcExp, DType, etype > &  src,
const TShape &  axes,
const TShape &  sizes 
)
inline

Broadcasting the tensor in the given axis (keepdim turned on)

Parameters
srcsource
axesbroadcasting axes
sizessizes of the broadcasting axes
Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
TShapethe flexible shape type
template<typename SrcExp , typename DType , int etype, int dimdst>
BroadcastScalarExp<SrcExp, DType, dimdst> mshadow::expr::broadcast_scalar ( const expr::Exp< SrcExp, DType, etype > &  src,
Shape< dimdst >  shape 
)
inline

a expression that replicate a scalar tensor to target dimension.

Parameters
srcTensor<Device,1>: shape[0] == 1
shapeshape of output
Returns
a expresion with type Tensor<Device, dimdst>
Template Parameters
dimcasttarget dimension where the 1D tensor will be broadcasted
SrcExptype of input expression
DTypethe type of elements
dimdstdimension of destination tensor
template<typename SrcExp , typename DType , int etype, typename TShape >
BroadcastWithMultiAxesExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::broadcast_to ( const Exp< SrcExp, DType, etype > &  src,
const TShape &  target_shape 
)
inline

Broadcasting the tensor to the target shape, dimension of different sizes must be 1 in the original tensor.

Parameters
srcsource
target_shapeshape of the target broadcasting tensor
Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
TShapethe flexible shape type
template<typename SrcExp , typename DType , int etype>
BroadcastWithAxisExp<SrcExp, DType, ExpInfo<SrcExp>::kDim, ExpInfo<SrcExp>::kDim + 1> mshadow::expr::broadcast_with_axis ( const Exp< SrcExp, DType, etype > &  src,
const int  axis,
const index_t  size 
)
inline

Broadcasting the tensor after given axis.

Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelUnpoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::ch_unpool ( const Exp< SrcExp, DType, etype > &  data_src,
const Exp< SrcExp, DType, etype > &  data_pooled,
const Exp< SrcExp, DType, etype > &  grad_pooled,
index_t  nsize,
index_t  stride,
index_t  pad 
)
inline

channel unpooling, do unroll over (local nearby) channels

Parameters
srcsource data
nsizeneighbor size
stridestride of the pooling
padnumber of padding at each side
Returns
expression of pooled result
Template Parameters
Reducerreducer type
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelUnpoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::ch_unpool ( const Exp< SrcExp, DType, etype > &  data_src,
const Exp< SrcExp, DType, etype > &  data_pooled,
const Exp< SrcExp, DType, etype > &  grad_pooled,
index_t  nsize 
)
inline
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelPoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::chpool ( const Exp< SrcExp, DType, etype > &  src,
index_t  nsize 
)
inline

channel pooling, do reduction over (local nearby) channels, used to implement local response normalization

Parameters
srcsource data
nsizeneighbor size
Returns
expression of pooled result
Template Parameters
Reducerreducer type
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename Reducer , typename SrcExp , typename DType , int etype>
ChannelPoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::chpool ( const Exp< SrcExp, DType, etype > &  src,
index_t  nsize,
index_t  stride,
index_t  pad 
)
inline
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryC2R, op::complex::abs_square, SrcExp, DType, (e1 | type::kMapper)> mshadow::expr::complex_abs_square ( const Exp< SrcExp, DType, e1 > &  src)
inline

complex_abs_square calculate the square of the modulus of A where A is a complex tensor

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryCC, op::complex::div, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_div_cc ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_cc Complex multipilication two complex tensors, A * B

template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryCR, op::complex::div, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_div_cr ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_cr Complex multipilication a complex tensor A and a real tensor B

template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryRC, op::complex::div, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_div_rc ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_rc Complex multipilication of a real tensor A and a complex tensor B

template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryC2C, op::complex::exchange, SrcExp, DType, (e1|type::kMapper)> mshadow::expr::complex_exchange ( const Exp< SrcExp, DType, e1 > &  src)
inline

complex_exchange Exchange the real and imaginary part of A where A is a complex tensor

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryCC, op::complex::mul, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_mul_cc ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_cc Complex multipilication two complex tensors, A * B

template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryCR, op::complex::mul, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_mul_cr ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_cr Complex multipilication a complex tensor A and a real tensor B

template<typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<op::complex::kBinaryRC, op::complex::mul, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::complex_mul_rc ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

complex_mul_rc Complex multipilication of a real tensor B and a complex tensor A

template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryR2C, op::complex::pad_imag, SrcExp, DType, (e1|type::kMapper)> mshadow::expr::complex_pad_imag ( const Exp< SrcExp, DType, e1 > &  src)
inline

complex_pad_imag Transform real matrix into complex matrix

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryC2R, op::complex::sum_real_imag, SrcExp, DType, (e1 | type::kMapper)> mshadow::expr::complex_sum_real_imag ( const Exp< SrcExp, DType, e1 > &  src)
inline
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryC2R, op::complex::toreal, SrcExp, DType, (e1 | type::kMapper)> mshadow::expr::complex_toreal ( const Exp< SrcExp, DType, e1 > &  src)
inline

complex_toreal convert complex matrix to real matrix, keep only real part

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<int calctype, typename OP , typename TA , typename TB , typename DType , int ta, int tb>
ComplexBinaryMapExp<calctype, OP, TA, TB, DType, (ta | tb | type::kMapper)> mshadow::expr::ComplexF ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline
template<int calctype, typename OP , typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<calctype, OP, SrcExp, DType, (e1 | type::kMapper)> mshadow::expr::ComplexF ( const Exp< SrcExp, DType, e1 > &  src)
inline

conj Negation the imaginary part of A where A is a complex tensor

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<int cdim, typename LhsExp , typename RhsExp , typename Device , typename DType , int srcdim>
ConcatExp<LhsExp, RhsExp, Device, DType, srcdim, srcdim - cdim> mshadow::expr::concat ( const TRValue< LhsExp, Device, srcdim, DType > &  src1,
const TRValue< RhsExp, Device, srcdim, DType > &  src2 
)
inline

concat two 4D tensor

Parameters
src1source tensor1
src2source tensor2
Returns
concated 4D tensor
Template Parameters
cdimthe dimension to concatnate on
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename SrcExp , typename DType , int e1>
ComplexUnitaryExp<op::complex::kUnitaryC2C, op::complex::conjugate, SrcExp, DType, (e1|type::kMapper)> mshadow::expr::conj ( const Exp< SrcExp, DType, e1 > &  src)
inline

conj Negation the imaginary part of A where A is a complex tensor

Parameters
srcsource tensor
Template Parameters
e1type of source expression
template<typename SrcExp , typename DType , int etype>
CroppingExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::crop ( const Exp< SrcExp, DType, etype > &  src,
Shape< 2 >  oshape 
)
inline

revserse operationg of padding, cut off boundaries, crop output from center of input

Parameters
srcoriginal image batches
oshapeoutput shape to be cropped
Returns
expression corresponding to padded result
Template Parameters
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename SrcExp , typename DType , int etype>
CroppingExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::crop ( const Exp< SrcExp, DType, etype > &  src,
Shape< 2 >  oshape,
index_t  start_height,
index_t  start_width 
)
inline

same as crop, but can specify starting position to do cropping

Parameters
srcoriginal image batches
oshapeoutput shape to be cropped
start_heightstart height position to do cropping
start_widthstart width position to do cropping
Returns
expression corresponding to padded result
Template Parameters
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename TA , typename TB , typename DType >
DotExp<TA, TB, false, false, DType> mshadow::expr::dot ( const RValueExp< TA, DType > &  lhs,
const RValueExp< TB, DType > &  rhs 
)
inline

dot operator def

template<typename TA , typename TB , typename DType >
DotExp<TA, TB, true, false, DType> mshadow::expr::dot ( const TransposeExp< TA, DType > &  lhs,
const RValueExp< TB, DType > &  rhs 
)
inline

dot operator def

template<typename TA , typename TB , typename DType >
DotExp<TA, TB, false, true, DType> mshadow::expr::dot ( const RValueExp< TA, DType > &  lhs,
const TransposeExp< TB, DType > &  rhs 
)
inline

dot operator def

template<typename TA , typename TB , typename DType >
DotExp<TA, TB, true, true, DType> mshadow::expr::dot ( const TransposeExp< TA, DType > &  lhs,
const TransposeExp< TB, DType > &  rhs 
)
inline

dot operator def

template<typename OP , typename TA , int ta>
BinaryMapExp<OP, TA, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (ta|type::kMapper)> mshadow::expr::F ( const Exp< TA, MSHADOW_SCALAR_, ta > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload for const

template<typename OP , typename TB , int tb>
BinaryMapExp<OP, ScalarExp<MSHADOW_SCALAR_>, TB, MSHADOW_SCALAR_, (tb|type::kMapper)> mshadow::expr::F ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const Exp< TB, MSHADOW_SCALAR_, tb > &  rhs 
)
inline

operator overload for const

template<typename OP >
BinaryMapExp<OP, ScalarExp<MSHADOW_SCALAR_>, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (1|type::kMapper)> mshadow::expr::F ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload for const

template<typename OP , typename TA , typename TB , typename TC , typename DType , int ta, int tb, int tc>
TernaryMapExp<OP, TA, TB, TC, DType, (ta|tb|tc|type::kMapper)> mshadow::expr::F ( const Exp< TA, DType, ta > &  item1,
const Exp< TB, DType, tb > &  item2,
const Exp< TC, DType, tc > &  item3 
)
inline

short hand for MakeExp, usage F<op>(item1,item2,item3). create a ternary operation expression

Parameters
item1first operand
item2second operand
item3third operand
Returns
the result expression
Template Parameters
ternaryoperator
TAitem1 expression
taitem1 expression type
TBitem2 expression
tbitem2 expression type
TCitem3 expression
tcitem3 expression type
See also
mshadow::op
template<typename OP , typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<OP, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::F ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

short hand for MakeExp, usage F<op>(lhs, rhs). create a binary operation expression

Parameters
lhsleft operand
rhsright operand
Returns
the result expression
Template Parameters
binaryoperator
TAlhs expression
talhs expression type
TBrhs expression
tbrhs expression type
See also
mshadow::op
template<typename OP , typename TA , typename DType , int ta>
UnaryMapExp<OP, TA, DType, (ta|type::kMapper)> mshadow::expr::F ( const Exp< TA, DType, ta > &  src)
inline

short hand for MakeExp, usage F<op>(src), create a unary operation expression

Parameters
srcsource expression
Returns
the result expression
Template Parameters
operator
TAsource expression
tasource expression type
See also
mshadow::op
template<typename SrcExp , typename Device , typename DType , int srcdim>
FlipExp<SrcExp, Device, DType, srcdim> mshadow::expr::flip ( const TRValue< SrcExp, Device, srcdim, DType > &  src,
int  dim 
)
inline

Flip a Tensor.

Parameters
srcsource tensor
beginThe beginning slice.
endThe end slice.
Returns
sliced tensor
Template Parameters
sdimthe dimension to slice on
SrcExpsource expression
DTypethe type of elements
etypetype of expression
Shape<2> mshadow::expr::GetShape ( const Shape< 2 > &  shape,
bool  transpose 
)
inline
template<typename LhsExp , typename RhsExp , typename DType , int e1, int e2>
ImplicitGEMMExp<LhsExp, RhsExp, DType> mshadow::expr::implicit_dot ( const Exp< LhsExp, DType, e1 > &  lhs,
const Exp< RhsExp, DType, e2 > &  rhs 
)
inline
template<typename OP , typename TA , typename TB , typename TC , typename DType , int ta, int tb, int tc>
TernaryMapExp<OP, TA, TB, TC, DType, (ta|tb|tc|type::kMapper)> mshadow::expr::MakeExp ( const Exp< TA, DType, ta > &  item1,
const Exp< TB, DType, tb > &  item2,
const Exp< TC, DType, tc > &  item3 
)
inline

make expression

template<typename OP , typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<OP, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::MakeExp ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

make expression

template<typename OP , typename TA , typename DType , int ta>
UnaryMapExp<OP, TA, DType, (ta|type::kMapper)> mshadow::expr::MakeExp ( const Exp< TA, DType, ta > &  src)
inline

make expression

template<PacketArch Arch, typename OP , typename TA , typename TB , typename DType , int etype>
PacketPlan< BinaryMapExp< OP, TA, TB, DType, etype >, DType, Arch > mshadow::expr::MakePacketPlan ( const BinaryMapExp< OP, TA, TB, DType, etype > &  e)
inline
template<PacketArch Arch, typename DType >
PacketPlan<ScalarExp<DType>, DType, Arch> mshadow::expr::MakePacketPlan ( const ScalarExp< DType > &  e)
inline
template<PacketArch Arch, typename T , typename DType >
PacketPlan<T, DType, Arch> mshadow::expr::MakePacketPlan ( const RValueExp< T, DType > &  e)
inline
template<PacketArch Arch, typename T , int dim, typename DType >
PacketPlan<T, DType, Arch> mshadow::expr::MakePacketPlan ( const MakeTensorExp< T, cpu, dim, DType > &  e)
inline
template<PacketArch Arch, typename OP , typename TA , typename DType , int etype>
PacketPlan<UnaryMapExp<OP, TA, DType, etype>, DType, Arch> mshadow::expr::MakePacketPlan ( const UnaryMapExp< OP, TA, DType, etype > &  e)
inline
template<typename IndexExp , typename DType >
Plan<OneHotEncodeExp<IndexExp, DType>, DType> mshadow::expr::MakePlan ( const OneHotEncodeExp< IndexExp, DType > &  exp)
inline
template<typename SrcExp , typename IndexExp , typename DType >
Plan<MatChooseRowElementExp<SrcExp, IndexExp, DType>, DType> mshadow::expr::MakePlan ( const MatChooseRowElementExp< SrcExp, IndexExp, DType > &  exp)
inline
template<typename DType >
Plan<RangeExp<DType>, DType> mshadow::expr::MakePlan ( const RangeExp< DType > &  exp)
inline
template<typename IndexExp , typename SrcExp , typename DType >
Plan<MaskExp<IndexExp, SrcExp, DType>, DType> mshadow::expr::MakePlan ( const MaskExp< IndexExp, SrcExp, DType > &  exp)
inline
template<typename IndexExp , typename SrcExp , typename DType >
Plan<TakeExp<IndexExp, SrcExp, DType>, DType> mshadow::expr::MakePlan ( const TakeExp< IndexExp, SrcExp, DType > &  exp)
inline
template<typename SrcExp , typename ValExp , typename IndexExp , typename DType >
Plan<MatFillRowElementExp<SrcExp, ValExp, IndexExp, DType>, DType> mshadow::expr::MakePlan ( const MatFillRowElementExp< SrcExp, ValExp, IndexExp, DType > &  exp)
inline
template<typename IndexExp , typename SrcExp , typename DType >
Plan<TakeGradExp<IndexExp, SrcExp, DType>, DType> mshadow::expr::MakePlan ( const TakeGradExp< IndexExp, SrcExp, DType > &  exp)
inline
template<typename LhsExp , typename RhsExp , typename DType >
Plan<ImplicitGEMMExp<LhsExp, RhsExp, DType>, DType> mshadow::expr::MakePlan ( const ImplicitGEMMExp< LhsExp, RhsExp, DType > &  exp)
inline
template<typename OP , typename TA , typename TB , typename DType , int etype>
Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > mshadow::expr::MakePlan ( const BinaryMapExp< OP, TA, TB, DType, etype > &  e)
inline
template<typename SrcExp , typename DType , int dimsrc, int etype>
Plan<TransposeIndicesExp<SrcExp, DType, dimsrc, etype>, DType> mshadow::expr::MakePlan ( const TransposeIndicesExp< SrcExp, DType, dimsrc, etype > &  e)
inline

make expression

template<typename OP , typename TA , typename TB , typename TC , typename DType , int etype>
Plan< TernaryMapExp< OP, TA, TB, TC, DType, etype >, DType > mshadow::expr::MakePlan ( const TernaryMapExp< OP, TA, TB, TC, DType, etype > &  e)
inline
template<typename DType >
Plan<ScalarExp<DType>, DType> mshadow::expr::MakePlan ( const ScalarExp< DType > &  e)
inline
template<typename DstDType , typename SrcDType , typename EType , int etype>
Plan<TypecastExp<DstDType, SrcDType, EType, etype>, DstDType> mshadow::expr::MakePlan ( const TypecastExp< DstDType, SrcDType, EType, etype > &  e)
inline
template<typename T , typename DType >
Plan<T, DType> mshadow::expr::MakePlan ( const RValueExp< T, DType > &  e)
inline
template<typename T , typename DType >
Plan<TransposeExp<T, DType>, DType> mshadow::expr::MakePlan ( const TransposeExp< T, DType > &  e)
inline
template<typename T , typename SrcExp , int dim, typename DType >
Plan<T, DType> mshadow::expr::MakePlan ( const MakeTensorExp< T, SrcExp, dim, DType > &  e)
inline
template<typename OP , typename TA , typename DType , int etype>
Plan<UnaryMapExp<OP, TA, DType, etype>, DType> mshadow::expr::MakePlan ( const UnaryMapExp< OP, TA, DType, etype > &  e)
inline
template<int calctype, typename OP , typename TA , typename TB , typename DType , int etype>
Plan<ComplexBinaryMapExp<calctype, OP, TA, TB, DType, etype>, DType> mshadow::expr::MakePlan ( const ComplexBinaryMapExp< calctype, OP, TA, TB, DType, etype > &  e)
inline
template<int calctype, typename OP , typename TA , typename DType , int etype>
Plan<ComplexUnitaryExp<calctype, OP, TA, DType, etype>, DType> mshadow::expr::MakePlan ( const ComplexUnitaryExp< calctype, OP, TA, DType, etype > &  e)
inline
template<typename SV , typename E , int dim, typename DType , PacketArch Arch>
void mshadow::expr::MapPacketPlan ( Tensor< cpu, dim, DType >  _dst,
const expr::PacketPlan< E, DType, Arch > &  plan 
)
inline

use PacketPlan to compute result

template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
MaskExp<IndexExp, SrcExp, DType> mshadow::expr::mask ( const Exp< IndexExp, DType, e1 > &  index,
const Exp< SrcExp, DType, e2 > &  src 
)
inline
template<typename SrcExp , typename IndexExp , typename DType , typename IDType , int e1, int e2>
MatChooseRowElementExp<SrcExp, IndexExp, DType> mshadow::expr::mat_choose_row_element ( const Exp< SrcExp, DType, e1 > &  src,
const Exp< IndexExp, IDType, e2 > &  index 
)
inline
template<typename SrcExp , typename ValExp , typename IndexExp , typename SDType , typename VDType , typename IDType , int e1, int e2, int e3>
MatFillRowElementExp<SrcExp, ValExp, IndexExp, SDType> mshadow::expr::mat_fill_row_element ( const Exp< SrcExp, SDType, e1 > &  src,
const Exp< ValExp, VDType, e2 > &  val,
const Exp< IndexExp, IDType, e3 > &  index 
)
inline
template<typename SrcExp , typename DType , int etype>
MirroringExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::mirror ( const Exp< SrcExp, DType, etype > &  src)
inline

mirroring expression, mirror images in width

Parameters
srcoriginal image batches
Returns
expression corresponding to mirrored result
Template Parameters
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename IndexExp , typename IDType , int e1>
OneHotEncodeExp<IndexExp, default_real_t> mshadow::expr::one_hot_encode ( const Exp< IndexExp, IDType, e1 > &  index,
index_t  num_choices 
)
inline
template<typename TA , typename TB , bool ltrans, bool rtrans>
DotExp<TA, TB, ltrans, rtrans, MSHADOW_SCALAR_> mshadow::expr::operator* ( const DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_ > &  lhs,
MSHADOW_SCALAR_  rhs 
)
inline

dot operator def

template<typename TA , typename TB , bool ltrans, bool rtrans>
DotExp<TA, TB, ltrans, rtrans, MSHADOW_SCALAR_> mshadow::expr::operator* ( MSHADOW_SCALAR_  lhs,
const DotExp< TA, TB, ltrans, rtrans, MSHADOW_SCALAR_ > &  rhs 
)
inline

scale of dot operation

template<typename E , typename DType , typename R , int d>
ReduceTo1DExp<E, DType, R, d> mshadow::expr::operator* ( const ReduceTo1DExp< E, DType, R, d > &  e,
MSHADOW_SCALAR_  scale 
)
inline

operator overload

template<typename E , typename DType , typename R , int d>
ReduceTo1DExp<E, DType, R, d> mshadow::expr::operator* ( MSHADOW_SCALAR_  scale,
const ReduceTo1DExp< E, DType, R, d > &  e 
)
inline

operator overload

template<typename TA , int ta>
BinaryMapExp<op::mul, TA, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (ta|type::kMapper)> mshadow::expr::operator* ( const Exp< TA, MSHADOW_SCALAR_, ta > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TB , int tb>
BinaryMapExp<op::mul, ScalarExp<MSHADOW_SCALAR_>, TB, MSHADOW_SCALAR_, (tb|type::kMapper)> mshadow::expr::operator* ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const Exp< TB, MSHADOW_SCALAR_, tb > &  rhs 
)
inline

operator overload

BinaryMapExp<op::mul, ScalarExp<MSHADOW_SCALAR_>, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (1|type::kMapper)> mshadow::expr::operator* ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<op::mul, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::operator* ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

operator overload

template<typename TA , int ta>
BinaryMapExp<op::plus, TA, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (ta|type::kMapper)> mshadow::expr::operator+ ( const Exp< TA, MSHADOW_SCALAR_, ta > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TB , int tb>
BinaryMapExp<op::plus, ScalarExp<MSHADOW_SCALAR_>, TB, MSHADOW_SCALAR_, (tb|type::kMapper)> mshadow::expr::operator+ ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const Exp< TB, MSHADOW_SCALAR_, tb > &  rhs 
)
inline

operator overload

BinaryMapExp<op::plus, ScalarExp<MSHADOW_SCALAR_>, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (1|type::kMapper)> mshadow::expr::operator+ ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<op::plus, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::operator+ ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

operator overload

template<typename TA , int ta>
BinaryMapExp<op::minus, TA, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (ta|type::kMapper)> mshadow::expr::operator- ( const Exp< TA, MSHADOW_SCALAR_, ta > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TB , int tb>
BinaryMapExp<op::minus, ScalarExp<MSHADOW_SCALAR_>, TB, MSHADOW_SCALAR_, (tb|type::kMapper)> mshadow::expr::operator- ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const Exp< TB, MSHADOW_SCALAR_, tb > &  rhs 
)
inline

operator overload

BinaryMapExp<op::minus, ScalarExp<MSHADOW_SCALAR_>, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (1|type::kMapper)> mshadow::expr::operator- ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<op::minus, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::operator- ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

operator overload

template<typename TA , int ta>
BinaryMapExp<op::div, TA, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (ta|type::kMapper)> mshadow::expr::operator/ ( const Exp< TA, MSHADOW_SCALAR_, ta > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TB , int tb>
BinaryMapExp<op::div, ScalarExp<MSHADOW_SCALAR_>, TB, MSHADOW_SCALAR_, (tb|type::kMapper)> mshadow::expr::operator/ ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const Exp< TB, MSHADOW_SCALAR_, tb > &  rhs 
)
inline

operator overload

BinaryMapExp<op::div, ScalarExp<MSHADOW_SCALAR_>, ScalarExp<MSHADOW_SCALAR_>, MSHADOW_SCALAR_, (1|type::kMapper)> mshadow::expr::operator/ ( const ScalarExp< MSHADOW_SCALAR_ > &  lhs,
const ScalarExp< MSHADOW_SCALAR_ > &  rhs 
)
inline

operator overload

template<typename TA , typename TB , typename DType , int ta, int tb>
BinaryMapExp<op::div, TA, TB, DType, (ta|tb|type::kMapper)> mshadow::expr::operator/ ( const Exp< TA, DType, ta > &  lhs,
const Exp< TB, DType, tb > &  rhs 
)
inline

operator overload

template<typename SrcExp , typename DType , int dstdim, int etype>
PackColToPatchXExp<SrcExp, DType, dstdim> mshadow::expr::pack_col2patch ( const expr::Exp< SrcExp, DType, etype > &  src,
Shape< dstdim >  imshape,
index_t  psize_y,
index_t  psize_x,
index_t  pstride,
index_t  pdilate 
)
inline

reverse operation of pack_col2patch, can be used to implement deconvolution

Returns
packed img expression
Parameters
matsource matrix
imshapeshape of target img
psize_yheight of each patch
psize_xheight of each patch
pstridestride of each patch
Template Parameters
SrcExpsource expression
DTypethe type of elements
dstdimdestination dimension
etypetype of expression
template<typename SrcExp , typename DType , int dstdim, int etype>
PackColToPatchXExp<SrcExp, DType, dstdim> mshadow::expr::pack_col2patch ( const expr::Exp< SrcExp, DType, etype > &  src,
Shape< dstdim >  imshape,
index_t  psize_y,
index_t  psize_x,
index_t  pstride_y,
index_t  pstride_x,
index_t  pdilate_y,
index_t  pdilate_x 
)
inline

if you want to specify kstride_y and kstride_x

template<typename SrcExp , typename DType , int etype>
PaddingExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::pad ( const Exp< SrcExp, DType, etype > &  src,
index_t  pad 
)
inline

padding expression, pad a image with zeros on boundaries, padding affects shape[0], and shape[1]

Parameters
srcoriginal image batches
padpadding size
Returns
expression corresponding to padded result
Template Parameters
SrcExpsource expression
DTypethe content data type
etypetype of expression
template<typename SrcExp , typename DType , int etype>
PaddingExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::pad ( const Exp< SrcExp, DType, etype > &  src,
index_t  pad_y,
index_t  pad_x 
)
inline

padding expression, pad a image with zeros on boundaries, padding affects shape[0], and shape[1]

Parameters
srcoriginal image batches
pad_ypadding size in y
pad_xpadding size in x
Returns
expression corresponding to padded result
Template Parameters
SrcExpsource expression
DTypethe content data type
etypetype of expression
template<typename Reducer , typename SrcExp , typename DType , int etype>
PoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::pool ( const Exp< SrcExp, DType, etype > &  src,
index_t  ksize_y,
index_t  ksize_x,
index_t  kstride_y,
index_t  kstride_x 
)
inline

pooling subregion results together

Parameters
srcsource image, shape: (batch, channel, height, width)
ksize_ykernel size in height
ksize_xkernel size in width
kstride_ystride in y directory
kstride_xstride in x directory
Returns
expression of pooled result
Template Parameters
Reducerreducer type
SrcExpsource expression
DTypethe content data type
etypetype of expression
template<typename Reducer , typename SrcExp , typename DType , int etype>
PoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::pool ( const Exp< SrcExp, DType, etype > &  src,
Shape< 2 >  pshape,
index_t  ksize_y,
index_t  ksize_x,
index_t  kstride_y,
index_t  kstride_x 
)
inline

same as pool, except the output shape is specified by pshape

Parameters
srcsource image
pshapeouput shape
ksize_ykernel size in y
ksize_xkernel size in x
kstride_ystride in y directory
kstride_xstride in x directory
Returns
expression of pooled result
Template Parameters
Reducerreducer type
SrcExpsource expression
DTypethe content data type
etypetype of expression
template<typename DType >
RangeExp<DType> mshadow::expr::range ( DType  start,
DType  stop,
DType  step = 1,
int  repeat = 1 
)
inline
template<typename DType >
int mshadow::expr::RangeOutSize ( DType  start,
DType  stop,
DType  step,
int  repeat 
)
inline
template<>
int mshadow::expr::RangeOutSize< double > ( double  start,
double  stop,
double  step,
int  repeat 
)
inline
template<>
int mshadow::expr::RangeOutSize< float > ( float  start,
float  stop,
float  step,
int  repeat 
)
inline
template<int dimkeep, typename Reducer , typename SrcExp , typename DType , int etype>
ReduceTo1DExp<SrcExp, DType, Reducer, ExpInfo<SrcExp>::kDim - dimkeep> mshadow::expr::reduce_except_dim ( const Exp< SrcExp, DType, etype > &  exp)
inline

reduce over all dimensions, except dimkeep

Parameters
expinput expression that must be a matrix Tensor<?,2>
Returns
a expresion with type Tensor<Device,1>
Template Parameters
dimkeepthe dimension that will be kept
SrcExpexpression
etypetype of expression
template<typename Reducer , bool mask, typename SrcExp , typename DType , int etype>
ReduceWithAxisExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim, mask, ExpInfo<SrcExp>::kDim> mshadow::expr::reduce_keepdim ( const Exp< SrcExp, DType, etype > &  src,
int  axis 
)
inline

reduce out the dimension of src labeled by axis, keepdim turned on.

Parameters
Reducertype of the reducing operation
maskwhether to output the unmask indices
Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
template<typename Reducer , bool mask, typename SrcExp , typename DType , int etype>
ReduceWithAxisExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim, mask, ExpInfo<SrcExp>::kDim - 1> mshadow::expr::reduce_with_axis ( const Exp< SrcExp, DType, etype > &  src,
int  axis 
)
inline

reduce out the dimension of src labeled by axis.

Parameters
Reducertype of the reducing operation
maskwhether to output the unmask indices
Template Parameters
SrcExpsource expression
DTypedata type
etypetype of the expression
template<typename SrcExp , typename DType , int etype>
Broadcast1DExp<SrcExp, DType, 2, 1> mshadow::expr::repmat ( const expr::Exp< SrcExp, DType, etype > &  src,
index_t  nrow 
)
inline

a expression that replicate a 1 dimension tensor for nrow times

Parameters
srcTensor<Device,1>: shape[0]
nrownumber of rows to replicate
Returns
a expresion with type Tensor<Device,2> size(1), size(0) = nrow
Template Parameters
Devicewhich device it lies
template<typename SrcExp , typename DType , int etype, int dimdst>
ReshapeExp<SrcExp, DType, dimdst, ExpInfo<SrcExp>::kDim> mshadow::expr::reshape ( const Exp< SrcExp, DType, etype > &  src,
Shape< dimdst >  oshape 
)
inline

a expression that reshapes a tensor to another shape

Parameters
srcTensor<Device,dimsrc>:
oshapetarget shape
Returns
a expresion with type Tensor<Device,dimdst>
Template Parameters
SrcExpsource expression
etypesource expression type
dimdsttarget dimension
template<typename DType >
ScalarExp<DType> mshadow::expr::scalar ( DType  s)
inline

create an scalar expression

template<typename SrcExp , typename Device , typename DType , int srcdim>
SliceExExp<SrcExp, Device, DType, srcdim> mshadow::expr::slice ( const TRValue< SrcExp, Device, srcdim, DType > &  src,
Shape< srcdim >  begin,
Shape< srcdim >  end 
)
inline

SliceEx a Tensor.

Parameters
srcsource tensor
beginThe beginning slice.
endThe end slice.
Returns
sliced tensor
Template Parameters
sdimthe dimension to slice on
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<int sdim, typename SrcExp , typename Device , typename DType , int srcdim>
SliceExp<SrcExp, Device, DType, srcdim, srcdim - sdim> mshadow::expr::slice ( const TRValue< SrcExp, Device, srcdim, DType > &  src,
index_t  begin,
index_t  end 
)
inline

Slice a Tensor.

Parameters
srcsource tensor
beginThe beginning slice.
endThe end slice.
Returns
sliced tensor
Template Parameters
sdimthe dimension to slice on
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename SrcExp , typename DType , int etype>
ReduceTo1DExp<SrcExp, DType, red::sum, 1> mshadow::expr::sum_rows ( const Exp< SrcExp, DType, etype > &  exp)
inline

a expression that sum over rows of a matrix

Parameters
expinput expression that must be a matrix Tensor<?, 2>
Returns
a expresion with type Tensor<Device, 1>
Template Parameters
SrcExpexpression
etypetype of expression
template<int dimkeep, typename SrcExp , typename DType , int etype>
ReduceTo1DExp<SrcExp, DType, red::sum, ExpInfo<SrcExp>::kDim - dimkeep> mshadow::expr::sumall_except_dim ( const Exp< SrcExp, DType, etype > &  exp)
inline

a sum over all dimensions, except dimkeep

Parameters
expinput expression that must be a matrix Tensor<?,2>
Returns
a expresion with type Tensor<Device,1>
Template Parameters
dimkeepthe dimension that will be kept
SrcExpexpression
etypetype of expression
template<int a1, int a2, typename SrcExp , typename DType , int etype>
SwapAxisExp<SrcExp, DType, ExpInfo<SrcExp>::kDim, ExpInfo<SrcExp>::kDim - a1, a2> mshadow::expr::swapaxis ( const Exp< SrcExp, DType, etype > &  src)
inline

a expression that reshapes a tensor to another shape

Parameters
srcTensor<Device,dimsrc>:
Returns
a expresion with type Tensor<Device,dimdst>
Template Parameters
a1higher dimension to be swapped, assert a1 > a2
a2lower dimension to be swapped
SrcExpsource expression
DTypethe type of elements
etypesource expression type
template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
TakeExp<IndexExp, SrcExp, DType> mshadow::expr::take ( const Exp< IndexExp, DType, e1 > &  index,
const Exp< SrcExp, DType, e2 > &  src 
)
inline
template<typename IndexExp , typename SrcExp , typename DType , int e1, int e2>
TakeGradExp<IndexExp, SrcExp, DType> mshadow::expr::take_grad ( const Exp< IndexExp, DType, e1 > &  index,
const Exp< SrcExp, DType, e2 > &  src,
const index_t  input_dim 
)
inline
template<typename DstDType , typename SrcDType , typename EType , int etype>
TypecastExp<DstDType, SrcDType, EType, (etype|type::kMapper)> mshadow::expr::tcast ( const Exp< EType, SrcDType, etype > &  exp)
inline

create an scalar expression

template<typename SrcExp , typename DType , int etype>
TransposeExExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::transpose ( const Exp< SrcExp, DType, etype > &  src,
Shape< ExpInfo< SrcExp >::kDim >  axes 
)
inline

a expression that reshapes a tensor to another shape

Parameters
srcTensor<Device,dimsrc>:
Returns
a expresion with type Tensor<Device,dimdst>
Template Parameters
a1higher dimension to be swapped, assert a1 > a2
a2lower dimension to be swapped
SrcExpsource expression
DTypethe type of elements
etypesource expression type
template<typename SrcExp , typename DType , int dimsrc, int etype>
TransposeIndicesExp<SrcExp, DType, dimsrc, etype> mshadow::expr::transpose_indices ( const Exp< SrcExp, DType, etype > &  src_indices,
Shape< dimsrc >  src_shape,
Shape< dimsrc >  axes 
)
inline

a expression that reshapes a tensor to another shape

Parameters
srcTensor<Device,dimsrc>:
Returns
a expresion with type Tensor<Device,dimdst>
Template Parameters
a1higher dimension to be swapped, assert a1 > a2
a2lower dimension to be swapped
SrcExpsource expression
DTypethe type of elements
etypesource expression type
template<typename SrcExp , typename DType , int etype>
UnpackPatchToColXExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::unpack_patch2col ( const Exp< SrcExp, DType, etype > &  img,
index_t  psize_y,
index_t  psize_x,
index_t  pstride,
index_t  pdilate 
)
inline

unpack local (overlap) patches of image to column of mat, can be used to implement convolution after getting unpacked mat, we can use: output = dot(weight, mat) to get covolved results, the relations:

weight; shape[0]: out_channel, shape[1]: ichannel * psize_y * psize_x output; shape[0]: out_channel, shape[1]: out_height * out_width * num_of_images out_height = (in_height - psize_y) / pstride + 1, this means we pad inperfect patch with 0 out_width = (in_width - psize_x) / pstride + 1

Returns
mat target matrix; shape[0]: in_channel*psize_y*psize_x shape[1]: out_height*out_width * num_of_images
Parameters
imgsource image; shape[-3]: in_channels, shape[-2]: in_height, shape[-1]: in_width, can be 3D or 4D tensor(multiple images)
psize_yheight of each patch
psize_xwidth of each patch
pstridestride of each patch
pdilatedilate of each patch
Template Parameters
SrcExpsource expression
DTypethe type of elements
etypetype of expression
template<typename SrcExp , typename DType , int etype>
UnpackPatchToColXExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::unpack_patch2col ( const Exp< SrcExp, DType, etype > &  img,
index_t  psize_y,
index_t  psize_x,
index_t  pstride_y_,
index_t  pstride_x_,
index_t  pdilate_y_,
index_t  pdilate_x_ 
)
inline

if you want to specify stride_x and stride_y

template<typename Reducer , typename SrcExp , typename DType , int etype>
UnPoolingExp<Reducer, SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::unpool ( const Exp< SrcExp, DType, etype > &  data_src,
const Exp< SrcExp, DType, etype > &  data_pooled,
const Exp< SrcExp, DType, etype > &  grad_pooled,
index_t  ksize_y,
index_t  ksize_x,
index_t  kstride_y,
index_t  kstride_x 
)
inline

unpooling gradient for 4D, backprop gradient value back, revserse operation of pooling, same as unpooling, but allows unequal size of kernel

Parameters
data_srcsource input, corresponds to src in pooling
data_pooledresult of pooled data, corresponds to result of pooling
grad_pooledgradient data of pooled part, to be propgate down
ksize_ykernel height
ksize_xkernel width
kstride_ystride in y directory
kstride_xstride in x directory
Returns
expression corresponding to unpooled 4D Tensor, storing backproped gradient
Template Parameters
Reducerreducer type
SrcExpsource expression
DTypethe content data type
etypetype of expression
template<typename SrcExp , typename DType , int etype>
UpSamplingNearestExp<SrcExp, DType, ExpInfo<SrcExp>::kDim> mshadow::expr::upsampling_nearest ( const Exp< SrcExp, DType, etype > &  src,
index_t  scale 
)
inline