namespace for abstract expressions and expressions template, have no dependecy 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...
|
struct | ExpEngine |
| expression engine that actually interprets these expressions this is a function template that needed to be implemented for specific expressions More...
|
|
class | ContainerExp |
| base class of all variables, that can be assigned to values More...
|
|
struct | Exp |
| base class for expression More...
|
|
struct | ScalarExp |
| scalar expression More...
|
|
struct | TransposeExp |
| represent a transpose expression of a container More...
|
|
struct | DotExp |
| matrix multiplication expression dot( lhs[.T], rhs[.T] ) More...
|
|
struct | BinaryMapExp |
| binary map expression lhs [op] rhs More...
|
|
struct | UnaryMapExp |
| unary map expression op(src) More...
|
|
struct | MakeTensorExp |
| a general class that allows extension that makes tensors of some shape More...
|
|
class | Plan |
| This part of code gives plan that can be used to carry out execution. More...
|
|
class | Plan< Tensor< Device, dim > > |
|
class | Plan< Tensor< Device, 1 > > |
|
class | Plan< ScalarExp > |
|
class | Plan< BinaryMapExp< OP, TA, TB, etype > > |
|
class | Plan< UnaryMapExp< OP, TA, etype > > |
|
struct | Plan< MakeTensorExp< SubType, SrcExp, dim > > |
|
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< ScalarExp > |
|
struct | ExpInfo< Tensor< Device, dim > > |
|
struct | ExpInfo< MakeTensorExp< T, SrcExp, dim > > |
|
struct | ExpInfo< UnaryMapExp< OP, TA, etype > > |
|
struct | ExpInfo< BinaryMapExp< OP, TA, TB, etype > > |
|
struct | TypeCheck |
| template to do type check More...
|
|
struct | TypeCheckPass |
|
struct | TypeCheckPass< false > |
|
struct | TypeCheckPass< true > |
|
struct | ShapeCheck |
|
struct | ShapeCheck< dim, ScalarExp > |
|
struct | ShapeCheck< dim, Tensor< Device, dim > > |
|
struct | ShapeCheck< dim, MakeTensorExp< T, SrcExp, dim > > |
|
struct | ShapeCheck< dim, UnaryMapExp< OP, TA, etype > > |
|
struct | ShapeCheck< dim, BinaryMapExp< OP, TA, TB, etype > > |
|
struct | DotEngine |
|
struct | BLASEngine |
|
struct | BLASEngine< cpu > |
|
struct | BLASEngine< gpu > |
|
struct | DotEngine< SV, xpu, 2, 2, 2, transpose_left, transpose_right > |
|
struct | DotEngine< SV, xpu, 1, 1, 2, false, transpose_right > |
|
struct | DotEngine< SV, xpu, 2, 1, 1, true, false > |
|
struct | ExpComplexEngine |
| some engine that evaluate complex expression More...
|
|
struct | ExpEngine< SV, Tensor< Device, dim > > |
|
struct | ExpComplexEngine< SV, Device, dim, DotExp< Tensor< Device, ldim >, Tensor< Device, rdim >, ltrans, rtrans > > |
|
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 | 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 | PackColToPatchXExp |
| reverse operation of UnpackPatchToCol, used to backprop gradient back this is a version supporting multiple images More...
|
|
struct | ReshapeExp |
| reshape the content to another shape input: Tensor<Device,dimsrc>: ishape output: Tensor<Device,dimdst> ishape.Size() == oshape.Size() More...
|
|
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 | ReduceTo1DExp |
| reduction to 1 dimension tensor input: Tensor<Device,k>: ishape output: Tensor<Device,1> shape[0] = ishape[dimkeep]; More...
|
|
struct | PoolingExp |
| pooling expression, do reduction over local patches of a image More...
|
|
struct | UnPoolingExp |
| unpooling expr reverse operation of pooling, used to pass gradient back More...
|
|
struct | PaddingExp |
| padding expression, pad a image with zeros More...
|
|
struct | CroppingExp |
| crop expression, cut off the boundary region, reverse operation of padding More...
|
|
struct | MirroringExp |
| mirror expression, mirror a image in width More...
|
|
struct | ChannelPoolingExp |
| channel pooling expression, do reduction over (local nearby) channels, used to implement local response normalization More...
|
|
struct | ExpComplexEngine< SV, Device, 1, ReduceTo1DExp< EType, Reducer, dimkeep > > |
|
struct | ExpComplexEngine< SV, Device, 1, ReduceTo1DExp< EType, Reducer, 0 > > |
|
struct | Plan< Broadcast1DExp< Device, dimdst, dimcast > > |
| execution plan of Broadcast1DExp More...
|
|
struct | Plan< Broadcast1DExp< Device, dimdst, 0 > > |
| execution plan of Broadcast1DExp More...
|
|
struct | Plan< UnpackPatchToColXExp< SrcExp, srcdim > > |
|
struct | Plan< PackColToPatchXExp< Device, dstdim > > |
|
struct | Plan< ReshapeExp< SrcExp, dimdst, dimsrc > > |
|
struct | Plan< ReshapeExp< SrcExp, dimdst, 1 > > |
|
struct | Plan< SwapAxisExp< SrcExp, dimsrc, a1, a2 > > |
|
struct | Plan< SwapAxisExp< SrcExp, dimsrc, 0, a2 > > |
|
struct | Plan< PoolingExp< Reducer, SrcExp, srcdim > > |
|
struct | Plan< UnPoolingExp< Reducer, Device > > |
|
struct | Plan< PaddingExp< SrcExp, srcdim > > |
|
struct | Plan< CroppingExp< SrcExp, srcdim > > |
|
struct | Plan< MirroringExp< SrcExp, srcdim > > |
|
struct | Plan< ChannelPoolingExp< Reducer, SrcExp, srcdim > > |
|
struct | SSECheck< Broadcast1DExp< cpu, dimdst, 0 > > |
|
struct | SSEAlignCheck< 2, Broadcast1DExp< cpu, dimdst, 0 > > |
|
class | SSEPlan< Broadcast1DExp< cpu, dimdst, 0 > > |
|
class | SSEPlan |
|
class | SSEPlan< Tensor< Device, dim > > |
|
class | SSEPlan< ScalarExp > |
|
class | SSEPlan< BinaryMapExp< OP, TA, TB, etype > > |
|
class | SSEPlan< UnaryMapExp< OP, TA, etype > > |
|
struct | SSECheck |
| static check sse enable if a expression E can not be evaluated using sse, then kPass = false More...
|
|
struct | SSECheck< ScalarExp > |
|
struct | SSECheck< Tensor< cpu, dim > > |
|
struct | SSECheck< UnaryMapExp< OP, TA, etype > > |
|
struct | SSECheck< BinaryMapExp< OP, TA, TB, etype > > |
|
struct | SSEAlignCheck |
|
struct | SSEAlignCheck< dim, ScalarExp > |
|
struct | SSEAlignCheck< dim, Tensor< cpu, dim > > |
|
struct | SSEAlignCheck< dim, UnaryMapExp< OP, TA, etype > > |
|
struct | SSEAlignCheck< dim, BinaryMapExp< OP, TA, TB, etype > > |
|
|
template<typename TA , typename TB > |
DotExp< TA, TB, false, false > | dot (const ContainerExp< TA > &lhs, const ContainerExp< TB > &rhs) |
| dot operator def
|
|
template<typename TA , typename TB > |
DotExp< TA, TB, true, false > | dot (const TransposeExp< TA > &lhs, const ContainerExp< TB > &rhs) |
| dot operator def
|
|
template<typename TA , typename TB > |
DotExp< TA, TB, false, true > | dot (const ContainerExp< TA > &lhs, const TransposeExp< TB > &rhs) |
| dot operator def
|
|
template<typename TA , typename TB > |
DotExp< TA, TB, true, true > | dot (const TransposeExp< TA > &lhs, const TransposeExp< TB > &rhs) |
| dot operator def
|
|
template<typename TA , typename TB , bool ltrans, bool rtrans> |
DotExp< TA, TB, ltrans, rtrans > | operator* (const DotExp< TA, TB, ltrans, rtrans > &lhs, real_t rhs) |
| dot operator def
|
|
template<typename TA , typename TB , bool ltrans, bool rtrans> |
DotExp< TA, TB, ltrans, rtrans > | operator* (real_t lhs, const DotExp< TA, TB, ltrans, rtrans > &rhs) |
| scale of dot operation
|
|
template<typename OP , typename TA , typename TB , int ta, int tb> |
BinaryMapExp< OP, TA, TB,(ta|tb|type::kMapper) > | MakeExp (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| make expression
|
|
template<typename OP , typename TA , typename TB , int ta, int tb> |
BinaryMapExp< OP, TA, TB,(ta|tb|type::kMapper) > | F (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| short hand for MakeExp, usage F<op>(lhs, rhs). create a binary operation expression More...
|
|
template<typename OP , typename TA , int ta> |
BinaryMapExp< OP, TA,
ScalarExp,(ta|type::kMapper) > | F (const Exp< TA, ta > &lhs, const ScalarExp &rhs) |
| operator overload for const
|
|
template<typename OP , typename TB , int tb> |
BinaryMapExp< OP, ScalarExp,
TB,(tb|type::kMapper) > | F (const ScalarExp &lhs, const Exp< TB, tb > &rhs) |
| operator overload for const
|
|
template<typename TA , typename TB , int ta, int tb> |
BinaryMapExp< op::plus, TA, TB,(ta|tb|type::kMapper) > | operator+ (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TA , typename TB , int ta, int tb> |
BinaryMapExp< op::minus, TA,
TB,(ta|tb|type::kMapper) > | operator- (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TA , typename TB , int ta, int tb> |
BinaryMapExp< op::mul, TA, TB,(ta|tb|type::kMapper) > | operator* (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TA , typename TB , int ta, int tb> |
BinaryMapExp< op::div, TA, TB,(ta|tb|type::kMapper) > | operator/ (const Exp< TA, ta > &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TA , int ta> |
BinaryMapExp< op::plus, TA,
ScalarExp,(ta|type::kMapper) > | operator+ (const Exp< TA, ta > &lhs, const ScalarExp &rhs) |
| operator overload
|
|
template<typename TA , int ta> |
BinaryMapExp< op::minus, TA,
ScalarExp,(ta|type::kMapper) > | operator- (const Exp< TA, ta > &lhs, const ScalarExp &rhs) |
| operator overload
|
|
template<typename TA , int ta> |
BinaryMapExp< op::mul, TA,
ScalarExp,(ta|type::kMapper) > | operator* (const Exp< TA, ta > &lhs, const ScalarExp &rhs) |
| operator overload
|
|
template<typename TA , int ta> |
BinaryMapExp< op::div, TA,
ScalarExp,(ta|type::kMapper) > | operator/ (const Exp< TA, ta > &lhs, const ScalarExp &rhs) |
| operator overload
|
|
template<typename TB , int tb> |
BinaryMapExp< op::plus,
ScalarExp, TB,(tb|type::kMapper) > | operator+ (const ScalarExp &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TB , int tb> |
BinaryMapExp< op::minus,
ScalarExp, TB,(tb|type::kMapper) > | operator- (const ScalarExp &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TB , int tb> |
BinaryMapExp< op::mul,
ScalarExp, TB,(tb|type::kMapper) > | operator* (const ScalarExp &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename TB , int tb> |
BinaryMapExp< op::div,
ScalarExp, TB,(tb|type::kMapper) > | operator/ (const ScalarExp &lhs, const Exp< TB, tb > &rhs) |
| operator overload
|
|
template<typename OP , typename TA , int ta> |
UnaryMapExp< OP, TA,(ta|type::kMapper) > | MakeExp (const Exp< TA, ta > &src) |
| make expression
|
|
template<typename OP , typename TA , int ta> |
UnaryMapExp< OP, TA,(ta|type::kMapper) > | F (const Exp< TA, ta > &src) |
| short hand for MakeExp, usage F<op>(src), create a unary operation expression More...
|
|
template<typename OP , typename TA , typename TB , int etype> |
Plan< BinaryMapExp< OP, TA, TB,
etype > > | MakePlan (const BinaryMapExp< OP, TA, TB, etype > &e) |
|
Plan< ScalarExp > | MakePlan (const ScalarExp &e) |
|
template<typename T > |
Plan< T > | MakePlan (const ContainerExp< T > &e) |
|
template<typename T , typename SrcExp , int dim> |
Plan< T > | MakePlan (const MakeTensorExp< T, SrcExp, dim > &e) |
|
template<typename OP , typename TA , int etype> |
Plan< UnaryMapExp< OP, TA,
etype > > | MakePlan (const UnaryMapExp< OP, TA, etype > &e) |
|
template<typename E , typename R , int d> |
ReduceTo1DExp< E, R, d > | operator* (const ReduceTo1DExp< E, R, d > &e, real_t scale) |
| operator overload
|
|
template<typename E , typename R , int d> |
ReduceTo1DExp< E, R, d > | operator* (real_t scale, const ReduceTo1DExp< E, R, d > &e) |
| operator overload
|
|
template<int dimcast, typename Device , int dimdst> |
Broadcast1DExp< Device, dimdst,
dimcast > | broadcast (const Tensor< Device, 1 > &src, Shape< dimdst > shape) |
| a expression that replicate a 1 dimension tensor in dimension dimcast More...
|
|
template<typename SrcExp , int etype> |
UnpackPatchToColXExp< SrcExp,
ExpInfo< SrcExp >::kDim > | unpack_patch2col (const Exp< SrcExp, etype > &img, index_t psize, index_t pstride) |
| 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 Device , int dstdim> |
PackColToPatchXExp< Device,
dstdim > | pack_col2patch (const Tensor< Device, 2 > &mat, Shape< dstdim > imshape, index_t psize, index_t pstride) |
| reverse operation of pack_col2patch, can be used to implement deconvolution More...
|
|
template<typename SrcExp , int etype, int dimdst> |
ReshapeExp< SrcExp, dimdst,
ExpInfo< SrcExp >::kDim > | reshape (const Exp< SrcExp, etype > &src, Shape< dimdst > oshape) |
| a expression that reshapes a tensor to another shape More...
|
|
template<int a1, int a2, typename SrcExp , int etype> |
SwapAxisExp< SrcExp, ExpInfo
< SrcExp >::kDim, a1, a2 > | swapaxis (const Exp< SrcExp, etype > &src) |
| a expression that reshapes a tensor to another shape More...
|
|
template<int dimkeep, typename SrcExp , int etype> |
ReduceTo1DExp< SrcExp,
red::sum, dimkeep > | sumall_except_dim (const Exp< SrcExp, etype > &exp) |
| a sum over all dimensions, except dimkeep More...
|
|
template<typename Reducer , typename SrcExp , int etype> |
PoolingExp< Reducer, SrcExp,
ExpInfo< SrcExp >::kDim > | pool (const Exp< SrcExp, etype > &src, index_t ksize, index_t kstride) |
| pooling subregion results together More...
|
|
template<typename Reducer , typename SrcExp , int etype> |
PoolingExp< Reducer, SrcExp,
ExpInfo< SrcExp >::kDim > | pool (const Exp< SrcExp, etype > &src, Shape< 2 > pshape, index_t ksize, index_t kstride) |
| same as pool, except the output shape is specified by pshape More...
|
|
template<typename Reducer , typename Device > |
UnPoolingExp< Reducer, Device > | unpool (const Tensor< Device, 4 > &data_src, const Tensor< Device, 4 > &data_pooled, const Tensor< Device, 4 > &grad_pooled, index_t ksize, index_t kstride) |
| unpooling gradient for 4D, backprop gradient value back, revserse operation of pooling More...
|
|
template<typename SrcExp , int etype> |
PaddingExp< SrcExp, ExpInfo
< SrcExp >::kDim > | pad (const Exp< SrcExp, 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 , int etype> |
CroppingExp< SrcExp, ExpInfo
< SrcExp >::kDim > | crop (const Exp< SrcExp, etype > &src, Shape< 2 > oshape) |
| revserse operationg of padding, cut off boundaries, crop output from center of input More...
|
|
template<typename SrcExp , int etype> |
CroppingExp< SrcExp, ExpInfo
< SrcExp >::kDim > | crop (const Exp< SrcExp, 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 , int etype> |
MirroringExp< SrcExp, ExpInfo
< SrcExp >::kDim > | mirror (const Exp< SrcExp, etype > &src) |
| mirroring expression, mirror images in width More...
|
|
template<typename Reducer , typename SrcExp , int etype> |
ChannelPoolingExp< Reducer,
SrcExp, ExpInfo< SrcExp >
::kDim > | chpool (const Exp< SrcExp, etype > &src, index_t nsize) |
| channel pooling, do reduction over (local nearby) channels, used to implement local response normalization More...
|
|
template<typename Device > |
Broadcast1DExp< Device, 2, 0 > | repmat (const Tensor< Device, 1 > &src, index_t nrow) |
| a expression that replicate a 1 dimension tensor for nrow times More...
|
|
template<typename SrcExp , int etype> |
ReduceTo1DExp< SrcExp,
red::sum, 0 > | sum_rows (const Exp< SrcExp, etype > &exp) |
| a expression that sum over rows of a matrix More...
|
|
template<typename OP , typename TA , typename TB , int etype> |
SSEPlan< BinaryMapExp< OP, TA,
TB, etype > > | MakeSSEPlan (const BinaryMapExp< OP, TA, TB, etype > &e) |
|
SSEPlan< ScalarExp > | MakeSSEPlan (const ScalarExp &e) |
|
template<typename T > |
SSEPlan< T > | MakeSSEPlan (const ContainerExp< T > &e) |
|
template<typename T , int dim> |
SSEPlan< T > | MakeSSEPlan (const MakeTensorExp< T, cpu, dim > &e) |
|
template<typename OP , typename TA , int etype> |
SSEPlan< UnaryMapExp< OP, TA,
etype > > | MakeSSEPlan (const UnaryMapExp< OP, TA, etype > &e) |
|