Function arm_nn_mat_mul_core_1x_s4¶
Defined in File arm_nnsupportfunctions.h
Function Documentation¶
-
arm_cmsis_nn_status arm_nn_mat_mul_core_1x_s4(int32_t row_elements, const int32_t skipped_row_elements, const int8_t *row_base_ref, const int8_t *col_base_ref, const int32_t out_ch, const cmsis_nn_conv_params *conv_params, const cmsis_nn_per_channel_quant_params *quant_params, const int32_t *bias, int8_t *output)¶
General Vector by Matrix multiplication with requantization, storage of result and int4 weights packed into an int8 buffer.
Pseudo-code as int8 example. Int4 filter data will be unpacked. *output = 0 sum_col = 0 for (j = 0; j < out_ch; j++) for (i = 0; i < row_elements; i++) *output += row_base_ref[i] * col_base_ref[i] sum_col += col_base_ref[i] scale sum_col using quant_params and bias store result in ‘output’
- Parameters:
row_elements – [in] number of row elements
skipped_row_elements – [in] number of row elements skipped due to padding. row_elements + skipped_row_elements = (kernel_x * kernel_y) * input_ch
row_base_ref – [in] pointer to row operand
col_base_ref – [in] pointer to col operand as packed int4
out_ch – [out] Number of output channels
conv_params – [in] Pointer to convolution parameters like offsets and activation values
quant_params – [in] Pointer to per-channel quantization parameters
bias – [in] Pointer to optional per-channel bias
output – [out] Pointer to output where int8 results are stored.
- Returns:
The function performs matrix(row_base_ref) multiplication with vector(col_base_ref) and scaled result is stored in memory.