10 #include "teq/coord.hpp" 12 #ifndef TEQ_FUNCARG_HPP 13 #define TEQ_FUNCARG_HPP 29 logs::fatal(
"cannot map a null tensor");
50 logs::fatal(
"cannot map a null tensor");
116 RankT rank, std::vector<DimT> red);
123 RankT rank, std::vector<DimT> ext);
138 #endif // TEQ_FUNCARG_HPP FuncArg(TensptrT tensor, CoordptrT shaper)
Construct FuncArg auto deducing coorder_ and map_io_ flag.
Definition: funcarg.hpp:24
FuncArg(TensptrT tensor, CoordptrT shaper, bool map_io, CoordptrT coorder)
Construct FuncArg with specific coorder_ and map_io_ flag.
Definition: funcarg.hpp:43
ArgsT to_args(TensptrsT tens)
Return ArgsT with each tensor in TensptrsT attached to identity mapper.
CoordptrT get_shaper(void) const
Return shaper coord map.
Definition: funcarg.hpp:67
bool map_io_
Definition: funcarg.hpp:94
std::vector< FuncArg > ArgsT
Type of functor arguments.
Definition: funcarg.hpp:101
bool map_io(void) const
Definition: funcarg.hpp:74
uint8_t RankT
Type used for shape rank.
Definition: shape.hpp:23
Shape shape(void) const
Return shape of tensor filtered through coordinate mapper.
Definition: funcarg.hpp:55
TensptrT get_tensor(void) const
Return tensor being mapped.
Definition: funcarg.hpp:61
std::shared_ptr< iCoordMap > CoordptrT
Type of iCoordMap smartpointer.
Definition: coord.hpp:106
FuncArg reduce_map(TensptrT tensor, RankT rank, std::vector< DimT > red)
TensptrT tensor_
Tensor reference.
Definition: funcarg.hpp:87
CoordptrT get_coorder(void) const
Return coord map for coordinates.
Definition: funcarg.hpp:80
Coordinate mapper and tensor pair.
Definition: funcarg.hpp:21
CoordptrT identity
Identity matrix instance.
CoordptrT shaper_
Shape mapper.
Definition: funcarg.hpp:90
FuncArg extend_map(TensptrT tensor, RankT rank, std::vector< DimT > ext)
FuncArg flip_map(TensptrT tensor, RankT dim)
Return FuncArg that flips input tensor along dimension.
std::shared_ptr< iTensor > TensptrT
Tensor smart pointer.
Definition: itensor.hpp:51
FuncArg permute_map(TensptrT tensor, std::vector< RankT > order)
std::vector< TensptrT > TensptrsT
Vector of tensor smart pointers.
Definition: itensor.hpp:60
Shape apply_shaper(const CoordptrT &shaper, Shape inshape)
FuncArg reduce_1d_map(TensptrT tensor, RankT rank)
CoordptrT coorder_
Coordinate mapper.
Definition: funcarg.hpp:97
NElemT n_elems(void) const
Return the total number of elements represented by the shape.
Definition: shape.hpp:118
FuncArg identity_map(TensptrT tensor)
Return FuncArg that identity maps input tensor.