13 #include <Eigen/CXX11/Tensor>
18 template <
int DataLayout>
31 reversed_tensor = tensor.
reverse(dim_rev);
38 for (
int i = 0;
i < 2; ++
i) {
39 for (
int j = 0;
j < 3; ++
j) {
40 for (
int k = 0; k < 5; ++k) {
41 for (
int l = 0;
l < 7; ++
l) {
53 reversed_tensor = tensor.
reverse(dim_rev);
61 for (
int i = 0;
i < 2; ++
i) {
62 for (
int j = 0;
j < 3; ++
j) {
63 for (
int k = 0; k < 5; ++k) {
64 for (
int l = 0;
l < 7; ++
l) {
76 reversed_tensor = tensor.
reverse(dim_rev);
84 for (
int i = 0;
i < 2; ++
i) {
85 for (
int j = 0;
j < 3; ++
j) {
86 for (
int k = 0; k < 5; ++k) {
87 for (
int l = 0;
l < 7; ++
l) {
96 template <
int DataLayout>
118 src_slice_dim[0] = 2;
119 src_slice_dim[1] = 3;
120 src_slice_dim[2] = 1;
121 src_slice_dim[3] = 7;
123 src_slice_start[0] = 0;
124 src_slice_start[1] = 0;
125 src_slice_start[2] = 0;
126 src_slice_start[3] = 0;
130 for (
int i = 0;
i < 5; ++
i) {
132 result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) =
133 tensor.
slice(src_slice_start, src_slice_dim);
135 result.slice(dst_slice_start, dst_slice_dim) =
136 tensor.
slice(src_slice_start, src_slice_dim).reverse(dim_rev);
138 src_slice_start[2] += 1;
139 dst_slice_start[2] += 1;
149 for (
int k = 0; k <
expected.dimension(2); ++k) {
157 dst_slice_start[2] = 0;
159 for (
int i = 0;
i < 5; ++
i) {
161 result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) =
162 tensor.
slice(dst_slice_start, dst_slice_dim);
164 result.slice(dst_slice_start, dst_slice_dim) =
165 tensor.
reverse(dim_rev).slice(dst_slice_start, dst_slice_dim);
167 dst_slice_start[2] += 1;
172 for (
int k = 0; k <
expected.dimension(2); ++k) {