13 #include <Eigen/CXX11/Tensor> 17 template <
int DataLayout,
typename Type=
float,
bool Exclusive = false>
28 for (
int i = 0;
i <
size;
i++) {
39 result = tensor.cumprod(0, Exclusive);
40 for (
int i = 0;
i <
size;
i++) {
51 template <
int DataLayout,
typename Type=
float>
60 result = tensor.cumsum(0);
62 for (
int i = 0;
i <
size;
i++) {
63 accum += tensor(
i, 1, 2, 3);
66 result = tensor.cumsum(1);
68 for (
int i = 0;
i <
size;
i++) {
69 accum += tensor(1,
i, 2, 3);
72 result = tensor.cumsum(2);
74 for (
int i = 0;
i <
size;
i++) {
75 accum += tensor(1, 2,
i, 3);
78 result = tensor.cumsum(3);
80 for (
int i = 0;
i <
size;
i++) {
81 accum += tensor(1, 2, 3,
i);
86 template <
int DataLayout>
95 for (
int i = 0;
i < 20; ++
i) {
96 accum += tensor_map(
i);
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
static void test_1d_scan()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
void test_cxx11_tensor_scan()
#define VERIFY_IS_EQUAL(a, b)
A tensor expression mapping an existing array of data.
#define CALL_SUBTEST(FUNC)
static void test_4d_scan()
static void test_tensor_maps()