Function arm_fully_connected_per_channel_s16¶
Defined in File arm_nnfunctions.h
Function Documentation¶
-
arm_cmsis_nn_status arm_fully_connected_per_channel_s16(const cmsis_nn_context *ctx, const cmsis_nn_fc_params *fc_params, const cmsis_nn_per_channel_quant_params *quant_params, const cmsis_nn_dims *input_dims, const int16_t *input_data, const cmsis_nn_dims *filter_dims, const int8_t *kernel, const cmsis_nn_dims *bias_dims, const int64_t *bias_data, const cmsis_nn_dims *output_dims, int16_t *output_data)¶
Basic s16 Fully Connected function using per channel quantization.
Supported framework: TensorFlow Lite
- Parameters:
ctx – [inout] Scratch buffer that this function writes before it reads, on every build. It is filled here with one reduced int32 multiplier per output channel derived from quant_params->multiplier, so the caller supplies the storage only and the incoming contents are never used. Unlike the s8 variants, no precomputed kernel sums are expected, and clearing the buffer is harmless. Required on every build, not only under MVE: ctx or ctx->buf being NULL is reported as ARM_CMSIS_NN_ARG_ERROR, as is a non-zero ctx->size smaller than the requirement. A ctx->size of 0 is treated as undeclared and is not checked. Sized by arm_fully_connected_per_channel_s16_get_buffer_size(): filter_dims->c * sizeof(int32_t), which equals the output_dims->c entries written. The caller is expected to clear the buffer afterwards, if applicable, for security reasons.
fc_params – [in] Fully Connected layer parameters. Range of fc_params->input_offset : 0 fc_params->filter_offset : 0 Range of fc_params->output_offset : 0
quant_params – [in] Per-channel quantization info. It contains the multiplier and shift values to be applied to each output channel
input_dims – [in] Input (activation) tensor dimensions. Format: [N, H, W, C_IN] Input dimension is taken as Nx(H * W * C_IN)
input_data – [in] Input (activation) data pointer. Data type: int16
filter_dims – [in] Two dimensional filter dimensions. Format: [N, C] N : accumulation depth and equals (H * W * C_IN) from input_dims C : output depth and equals C_OUT in output_dims H & W : Not used
kernel – [in] Filter data pointer. Data type: int8
bias_dims – [in] Bias tensor dimensions. Format: [C_OUT] N, H, W : Not used
bias_data – [in] Bias data pointer. Data type: int64
output_dims – [in] Output tensor dimensions. Format: [N, C_OUT] N : Batches C_OUT : Output depth H & W : Not used.
output_data – [inout] Output data pointer. Data type: int16
- Returns:
The function returns either
ARM_CMSIS_NN_ARG_ERRORif argument constraints fail. or,ARM_CMSIS_NN_SUCCESSon successful completion.