31 const Shape &unextended_output_shape, T *output_data, int32_t block_size)
35 const Shape input_shape = Shape::ExtendedShape(4, unextended_input_shape);
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);
46 const int stride = block_size * output_depth;
48 for (
int batch = 0; batch < batch_size; ++batch)
50 for (
int in_h = 0; in_h < input_height; ++in_h)
52 const T *input_ptr = input_data +
Offset(input_shape, batch, in_h, 0, 0);
53 for (
int offset_h = 0; offset_h < block_size; ++offset_h)
55 const T *src = input_ptr;
56 for (
int in_w = 0; in_w < input_width; ++in_w)
58 memcpy(output_data, src, stride *
sizeof(T));
59 output_data += stride;