53 int32_t output_operand_index,
const void *parameters)
58 int32_t input_operand_index = input_operand_indexes[0];
59 int number = operands[input_operand_index].
dims[0];
60 int height = operands[input_operand_index].
dims[1];
61 int width = operands[input_operand_index].
dims[2];
63 const float *
input = operands[input_operand_index].
data;
66 int new_channels =
channels / (block_size * block_size);
68 int by_linesize = output_linesize / block_size;
69 int x_linesize = new_channels * block_size;
71 DnnOperand *output_operand = &operands[output_operand_index];
72 output_operand->
dims[0] = number;
74 output_operand->
dims[2] =
width * block_size;
75 output_operand->
dims[3] = new_channels;
78 if (output_operand->
length <= 0)
81 if (!output_operand->
data)
85 for (y = 0; y <
height; ++y){
86 for (x = 0; x <
width; ++x){
87 for (by = 0; by < block_size; ++by){
88 for (bx = 0; bx < block_size; ++bx){
89 for (ch = 0; ch < new_channels; ++ch){
90 output[by * by_linesize + x * x_linesize + bx * new_channels + ch] =
input[ch];
92 input += new_channels;