12 #ifndef DBG_TENSOR_HPP 13 #define DBG_TENSOR_HPP 31 void print (std::ostream& out, T* arr, std::vector<uint8_t> shape)
40 void print_helper (std::ostream& out,
const std::vector<uint8_t>& shape,
44 uint16_t n = shape[rank];
53 for (uint16_t i = 1; i < n; ++i)
60 auto it = shape.begin();
61 size_t before = std::accumulate(it, it + rank, (
size_t) 1,
62 std::multiplies<size_t>());
64 for (uint16_t i = 1; i < n; ++i)
78 #endif // DBG_TENSOR_HPP void print(std::ostream &out, T *arr, std::vector< uint8_t > shape)
Definition: tensor.hpp:31
void print_helper(std::ostream &out, const std::vector< uint8_t > &shape, T *arr, uint8_t rank)
Definition: tensor.hpp:40
PrettyTensor(std::vector< uint16_t > datalimit)
Definition: tensor.hpp:25
Draw data as a multi-dimension array (similar to python) according to shape.
Definition: tensor.hpp:17
EigenptrT< T > min(teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b)
Definition: operator.hpp:939
std::vector< uint16_t > datalimit_
Number of elements to show for each dimension.
Definition: tensor.hpp:37