36 cmsis_nn_dims input_dims;
37 cmsis_nn_dims output_dims;
38 cmsis_nn_pool_params pool_params;
39 cmsis_nn_dims filter_dims;
42 const int depth = input_shape.
dims(3);
46 input_dims.h = input_shape.
dims(1);
47 input_dims.w = input_shape.
dims(2);
52 output_dims.w = output_width;
53 output_dims.c = depth;
55 pool_params.stride.h = params.
stride_h;
56 pool_params.stride.w = params.
stride_w;
57 pool_params.padding.h = params.
pad_h;
58 pool_params.padding.w = params.
pad_w;
67 const int32_t buffer_size = arm_avgpool_s8_get_buffer_size(output_width, depth);
68 int8_t *buffer =
nullptr;
71 buffer =
new int8_t[buffer_size];
75 ctx.size = buffer_size;
77 auto res = arm_avgpool_s8(&ctx, &pool_params, &input_dims, input_data, &filter_dims, &output_dims,
83 assert(res == ARM_CMSIS_NN_SUCCESS);
84 if (res != ARM_CMSIS_NN_SUCCESS)