12 #include <Eigen/CXX11/Tensor>
17 template <
int DataLayout>
29 no_shuffle = tensor.
shuffle(shuffles);
36 for (
int i = 0;
i < 2; ++
i) {
37 for (
int j = 0;
j < 3; ++
j) {
38 for (
int k = 0; k < 5; ++k) {
39 for (
int l = 0;
l < 7; ++
l) {
51 shuffle = tensor.
shuffle(shuffles);
58 for (
int i = 0;
i < 2; ++
i) {
59 for (
int j = 0;
j < 3; ++
j) {
60 for (
int k = 0; k < 5; ++k) {
61 for (
int l = 0;
l < 7; ++
l) {
70 template <
int DataLayout>
91 for (
int i = 0;
i < 5; ++
i) {
92 result.slice(dst_slice_start, dst_slice_dim) =
93 tensor.
slice(src_slice_start, src_slice_dim).shuffle(shuffles);
94 src_slice_start[2] += 1;
95 dst_slice_start[0] += 1;
105 for (
int k = 0; k <
expected.dimension(2); ++k) {
113 dst_slice_start[0] = 0;
115 for (
int i = 0;
i < 5; ++
i) {
116 result.slice(dst_slice_start, dst_slice_dim) =
117 tensor.
shuffle(shuffles).slice(dst_slice_start, dst_slice_dim);
118 dst_slice_start[0] += 1;
123 for (
int k = 0; k <
expected.dimension(2); ++k) {
133 template <
int DataLayout>
144 shuffle.
shuffle(shuffles) = tensor;
151 for (
int i = 0;
i < 2; ++
i) {
152 for (
int j = 0;
j < 3; ++
j) {
153 for (
int k = 0; k < 5; ++k) {
154 for (
int l = 0;
l < 7; ++
l) {
168 for (
int i = 0;
i < 5; ++
i) {
169 for (
int j = 0;
j < 7; ++
j) {
170 for (
int k = 0; k < 3; ++k) {
171 for (
int l = 0;
l < 2; ++
l) {
180 template <
int DataLayout>
188 for (
int i = 0;
i < 4; ++
i) {
192 for (
int i = 0;
i < 4; ++
i) {
193 const ptrdiff_t index = internal::random<ptrdiff_t>(
i, 3);
194 shuffles_inverse[shuffles[index]] =
i;
199 shuffle = tensor.
shuffle(shuffles).shuffle(shuffles_inverse);
206 for (
int i = 0;
i < 2; ++
i) {
207 for (
int j = 0;
j < 3; ++
j) {
208 for (
int k = 0; k < 5; ++k) {
209 for (
int l = 0;
l < 7; ++
l) {
218 template <
int DataLayout>
230 no_shuffle = tensor.
shuffle(shuffles);
237 for (
int i = 0;
i < 2; ++
i) {
238 for (
int j = 0;
j < 3; ++
j) {
239 for (
int k = 0; k < 0; ++k) {
240 for (
int l = 0;
l < 7; ++
l) {
252 shuffle = tensor.
shuffle(shuffles);
259 for (
int i = 0;
i < 2; ++
i) {
260 for (
int j = 0;
j < 3; ++
j) {
261 for (
int k = 0; k < 0; ++k) {
262 for (
int l = 0;
l < 7; ++
l) {