CMSIS-NN
Version 3.0.0
CMSIS NN Software Library
|
Functions | |
arm_status | arm_avgpool_s8 (const cmsis_nn_context *ctx, const cmsis_nn_pool_params *pool_params, const cmsis_nn_dims *input_dims, const q7_t *src, const cmsis_nn_dims *filter_dims, const cmsis_nn_dims *output_dims, q7_t *dst) |
s8 average pooling function. More... | |
int32_t | arm_avgpool_s8_get_buffer_size (const int output_x, const int ch_src) |
Get the required buffer size for S8 average pooling function. More... | |
arm_status | arm_max_pool_s8 (const cmsis_nn_context *ctx, const cmsis_nn_pool_params *pool_params, const cmsis_nn_dims *input_dims, const q7_t *src, const cmsis_nn_dims *filter_dims, const cmsis_nn_dims *output_dims, q7_t *dst) |
s8 max pooling function. More... | |
void | arm_maxpool_q7_HWC (q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out) |
Q7 max pooling function. More... | |
void | arm_avepool_q7_HWC (q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out) |
Q7 average pooling function. More... | |
Perform pooling functions, including max pooling and average pooling
void arm_avepool_q7_HWC | ( | q7_t * | Im_in, |
const uint16_t | dim_im_in, | ||
const uint16_t | ch_im_in, | ||
const uint16_t | dim_kernel, | ||
const uint16_t | padding, | ||
const uint16_t | stride, | ||
const uint16_t | dim_im_out, | ||
q7_t * | bufferA, | ||
q7_t * | Im_out | ||
) |
[in,out] | Im_in | pointer to input tensor |
[in] | dim_im_in | input tensor dimention |
[in] | ch_im_in | number of input tensor channels |
[in] | dim_kernel | filter kernel size |
[in] | padding | padding sizes |
[in] | stride | convolution stride |
[in] | dim_im_out | output tensor dimension |
[in,out] | bufferA | pointer to buffer space for input |
[in,out] | Im_out | pointer to output tensor |
Buffer size:
bufferA size: 2*dim_im_out*ch_im_in
The pooling function is implemented as split x-pooling then y-pooling.
This pooling function is input-destructive. Input data is undefined after calling this function.
References arm_q7_to_q15_no_shift().
arm_status arm_avgpool_s8 | ( | const cmsis_nn_context * | ctx, |
const cmsis_nn_pool_params * | pool_params, | ||
const cmsis_nn_dims * | input_dims, | ||
const q7_t * | input_data, | ||
const cmsis_nn_dims * | filter_dims, | ||
const cmsis_nn_dims * | output_dims, | ||
q7_t * | output_data | ||
) |
[in,out] | ctx | Function context (e.g. temporary buffer). Check the function definition file to see if an additional buffer is required. Optional function {API}_get_buffer_size() provides the buffer size if an additional buffer is required. |
[in] | pool_params | Pooling parameters |
[in] | input_dims | Input (activation) tensor dimensions. Format: [H, W, C_IN] Argument 'N' is not used. |
[in] | input_data | Input (activation) data pointer. Data type: int8 |
[in] | filter_dims | Filter tensor dimensions. Format: [H, W] Argument N and C are not used. |
[in] | output_dims | Output tensor dimensions. Format: [H, W, C_OUT] Argument N is not used. C_OUT equals C_IN. |
[in,out] | output_data | Output data pointer. Data type: int8 |
ARM_MATH_SUCCESS
- Successful operationReferences cmsis_nn_pool_params::activation, cmsis_nn_context::buf, cmsis_nn_dims::c, cmsis_nn_tile::h, cmsis_nn_dims::h, MAX, cmsis_nn_activation::max, MIN, cmsis_nn_activation::min, cmsis_nn_pool_params::padding, cmsis_nn_pool_params::stride, cmsis_nn_tile::w, and cmsis_nn_dims::w.
int32_t arm_avgpool_s8_get_buffer_size | ( | const int | dim_dst_width, |
const int | ch_src | ||
) |
[in] | dim_dst_width | output tensor dimension |
[in] | ch_src | number of input tensor channels |
arm_status arm_max_pool_s8 | ( | const cmsis_nn_context * | ctx, |
const cmsis_nn_pool_params * | pool_params, | ||
const cmsis_nn_dims * | input_dims, | ||
const q7_t * | input_data, | ||
const cmsis_nn_dims * | filter_dims, | ||
const cmsis_nn_dims * | output_dims, | ||
q7_t * | output_data | ||
) |
[in,out] | ctx | Function context (e.g. temporary buffer). Check the function definition file to see if an additional buffer is required. Optional function {API}_get_buffer_size() provides the buffer size if an additional buffer is required. |
[in] | pool_params | Pooling parameters |
[in] | input_dims | Input (activation) tensor dimensions. Format: [H, W, C_IN] Argument 'N' is not used. |
[in] | input_data | Input (activation) data pointer. Data type: int8 |
[in] | filter_dims | Filter tensor dimensions. Format: [H, W] Argument N and C are not used. |
[in] | output_dims | Output tensor dimensions. Format: [H, W, C_OUT] Argument N is not used. C_OUT equals C_IN. |
[in,out] | output_data | Output data pointer. Data type: int8 |
ARM_MATH_SUCCESS
- Successful operationReferences cmsis_nn_pool_params::activation, cmsis_nn_dims::c, clamp_output(), compare_and_replace_if_larger_q7(), cmsis_nn_tile::h, cmsis_nn_dims::h, MAX, cmsis_nn_activation::max, MIN, cmsis_nn_activation::min, cmsis_nn_pool_params::padding, cmsis_nn_pool_params::stride, cmsis_nn_tile::w, and cmsis_nn_dims::w.
void arm_maxpool_q7_HWC | ( | q7_t * | Im_in, |
const uint16_t | dim_im_in, | ||
const uint16_t | ch_im_in, | ||
const uint16_t | dim_kernel, | ||
const uint16_t | padding, | ||
const uint16_t | stride, | ||
const uint16_t | dim_im_out, | ||
q7_t * | bufferA, | ||
q7_t * | Im_out | ||
) |
[in,out] | Im_in | pointer to input tensor |
[in] | dim_im_in | input tensor dimention |
[in] | ch_im_in | number of input tensor channels |
[in] | dim_kernel | filter kernel size |
[in] | padding | padding sizes |
[in] | stride | convolution stride |
[in] | dim_im_out | output tensor dimension |
[in,out] | bufferA | Not used |
[in,out] | Im_out | pointer to output tensor |
The pooling function is implemented as split x-pooling then y-pooling.
This pooling function is input-destructive. Input data is undefined after calling this function.
References compare_and_replace_if_larger_q7().