38 const int input_depth = input_shape.
dims(3);
39 const int input_width = input_shape.
dims(2);
40 const int input_height = input_shape.
dims(1);
41 const int input_batch = input_shape.
dims(0);
43 for (
int in_b = 0; in_b < input_batch; ++in_b)
45 for (
int in_h = 0; in_h < input_height; ++in_h)
47 for (
int in_w = 0; in_w < input_width; ++in_w)
49 for (
int in_d = 0; in_d < input_depth; ++in_d)
52 in_d + ((in_h % block_size) * block_size + in_w % block_size) * input_depth;
53 const int out_w = in_w / block_size;
54 const int out_h = in_h / block_size;
55 const int out_b = in_b;
57 const int input_index =
offset(input_shape.
dimsData(), in_b, in_h, in_w, in_d);
60 output_data[output_index] = input_data[input_index];