The fully connected functions multiply the input vector by a weight matrix and add a bias, if any, to the result. The supported combinations of input vector and weight matrix are (signed 8-bit integer, signed 8-bit integer), (unsigned 8-bit integer, signed 8-bit integer), (signed 16-bit integer, signed 8-bit integer), (signed 16-bit integer, signed 16-bit integer) and (16-bit half-precision floating point, 16-bit half-precision floating point). More...
Functions | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sft_bias (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q7_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) return riscv_nn_fc_s8_s8_s8_sft_bias(in_vec |
| This is a fully connected layer function for signed 8-bit integer inputs with shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sft_bias_fast (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q7_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs with interleaved multiplication and shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s16_s16_s16_sft_bias (const q15_t *in_vec, const q15_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q15_t *bias, q15_t *out_vec, q15_t *tmp_buf) |
| This is a fully connected layer function for signed 16-bit integer inputs with shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s16_s16_s16_sft_bias_fast (const q15_t *in_vec, const q15_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q15_t *bias, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 16-bit integer inputs with interleaved multiplication and shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_mat_vec_s16_s16_s8_sft_bias (const q15_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q7_t *bias, q15_t *out_vec, q15_t *tmp_buf) |
| This function multiplies a signed 16-bit integer input vector by a signed 8-bit integer weight matrix with shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_mat_vec_s16_s16_s8_sft_bias_fast (const q15_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t bias_lshift, const uint16_t out_rshift, const q7_t *bias, q15_t *out_vec, q15_t *tmp_buf) |
| This function multiplies a signed 16-bit integer input vector by a signed 8-bit integer weight matrix with interleaved multiplication and shift-based quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sym_bias (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs/outputs with bias inputs and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s16_s8_sym_bias (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with bias inputs and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_u8_s8_sym_bias (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, u8_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with bias inputs and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s8_s8_sym_bias (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with bias inputs and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s16_s8_sym_bias (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with bias inputs and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sym (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs/outputs with symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s16_s8_sym (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_u8_s8_sym (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, u8_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s8_s8_sym (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s16_s8_sym (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sym_bias_fast (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs/outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s16_s8_sym_bias_fast (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_u8_s8_sym_bias_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, u8_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s8_s8_sym_bias_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s16_s8_sym_bias_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, const q31_t *bias, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_sym_fast (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs/outputs with interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s16_s8_sym_fast (const q7_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_u8_s8_sym_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, u8_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s8_s8_sym_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q7_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_u8_s16_s8_sym_fast (const u8_t *in_vec, const q7_t *wt_mat, const uint16_t size, const uint16_t wt_row_num, const uint16_t pre_rshift, const uint16_t out_scale, const uint16_t post_rshift, q15_t *out_vec, q15_t *in_tmp_buf) |
| This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs. More... | |
| static void | hpm_nn_fc_s8_wt_converter (const q7_t *wt_mat, const uint32_t size, const uint32_t wt_row_num, q7_t *wt_mat_out) |
| This is a weight converter for those fully-connected functions with signed 8-bit weight data and named with "fast". More... | |
| static void | hpm_nn_fc_s16_wt_converter (const q15_t *wt_mat, const uint32_t size, const uint32_t wt_row_num, q15_t *wt_mat_out) |
| This is a weight converter for those fully-connected functions with signed 16-bit weight data and named with "fast". More... | |
| static void | hpm_nn_fc_mat_vec_s8_wt_converter (const q7_t *wt_mat, const uint32_t size, const uint32_t wt_row_num, q7_t *wt_mat_out) |
| This is a weight converter for riscv_nn_fc_mat_vec_s16_s16_s8_sft_bias_fast. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_asym_bias (const int8_t *in_vec, const int8_t *wt_mat, const uint16_t in_vec_col, const uint16_t wt_mat_row, const uint16_t in_vec_group, const int32_t in_offset, const int32_t wt_offset, const int32_t out_scale, const int32_t out_shift, const int32_t out_offset, const int32_t *bias, int8_t *out_vec, const int32_t act_min, const int32_t act_max, q15_t *tmp_buf) |
| This is a fully connected layer function for signed 8-bit integer inputs with bias inputs and asymmetric quantization on the outputs. More... | |
| static int32_t | hpm_nn_fc_s8_s8_s8_asym_bias_get_buffer_size (const uint16_t in_vec_col) |
| This function is used to get the needed size, in bytes, by the temporary buffer of riscv_nn_fc_s8_s8_s8_asym_bias. More... | |
Variables | |
| static int32_t | wt_mat |
| static int32_t | wt_row_num |
| static int32_t | bias_lshift |
| static int32_t | out_rshift |
| static int32_t | bias |
| static int32_t | out_vec |
| static int32_t | in_tmp_buf |
The fully connected functions multiply the input vector by a weight matrix and add a bias, if any, to the result. The supported combinations of input vector and weight matrix are (signed 8-bit integer, signed 8-bit integer), (unsigned 8-bit integer, signed 8-bit integer), (signed 16-bit integer, signed 8-bit integer), (signed 16-bit integer, signed 16-bit integer) and (16-bit half-precision floating point, 16-bit half-precision floating point).
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This function multiplies a signed 16-bit integer input vector by a signed 8-bit integer weight matrix with shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias |
| [out] | out_vec | pointer of the output vector |
| [in] | tmp_buf | dummy |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This function multiplies a signed 16-bit integer input vector by a signed 8-bit integer weight matrix with interleaved multiplication and shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias |
| [out] | out_vec | pointer of the output vector |
| [in] | tmp_buf | dummy |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a weight converter for riscv_nn_fc_mat_vec_s16_s16_s8_sft_bias_fast.
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [out] | wt_mat_out | pointer of the weight matrix stored in specific ordering |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 16-bit integer inputs with shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias |
| [out] | out_vec | pointer of the output vector |
| [in] | tmp_buf | dummy |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 16-bit integer inputs with interleaved multiplication and shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 4 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a weight converter for those fully-connected functions with signed 16-bit weight data and named with "fast".
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [out] | wt_mat_out | pointer of the weight matrix stored in specific ordering |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with bias inputs and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs and signed 16-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs with bias inputs and asymmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the transposed weight matrix |
| [in] | in_vec_col | number of columns in the input vector (or transposed weight matrix) |
| [in] | wt_mat_row | number of rows in the transposed weight matrix |
| [in] | in_vec_group | number of input vector groups |
| [in] | in_offset | value of offset to be added to the input tensor. It should be in the range of -127 to 128. |
| [in] | wt_offset | value of offset to be added to the weight. It should be in the range of -127 to 128. |
| [in] | out_scale | value of sacling for the output tensor |
| [in] | out_shift | shift amount for the output tensor |
| [in] | out_offset | value of offset to be added to the output tensor. It should be in the range of -128 to 127. |
| [in] | bias | pointer of the bias vector |
| [in] | out_vec | pointer of the output vector |
| [in] | act_min | minimum value to clip out the ouput tensor. It should be in the range of -128 to 127. |
| [in] | act_max | maximum value to clip out the ouput tensor. It should be in the range of -128 to 127. |
| [in] | tmp_buf | dummy |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This function is used to get the needed size, in bytes, by the temporary buffer of riscv_nn_fc_s8_s8_s8_asym_bias.
| [in] | in_vec_col | number of columns in the input vector (or transposed weight matrix) |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs with shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | dummy |
Example:
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs with interleaved multiplication and shift-based quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | bias_lshift | left shift amount for the bias |
| [in] | out_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be "2 * size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs/outputs with symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs/outputs with bias inputs and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs/outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for signed 8-bit integer inputs/outputs with interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a weight converter for those fully-connected functions with signed 8-bit weight data and named with "fast".
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [out] | wt_mat_out | pointer of the weight matrix stored in specific ordering |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with bias inputs and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 16-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with bias inputs and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs and signed 8-bit integer outputs with interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with bias inputs and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output before the scaling |
| [in] | out_scale | scaling value for the output |
| [in] | post_rshift | right shift amount for the output after the scaling |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-dsp is enabled and its size must be "size". |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with bias inputs, interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [in] | bias | pointer of the bias vector |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
|
inlinestatic |
#include <middleware/hpm_math/hpm_math.h>
This is a fully connected layer function for unsigned 8-bit integer inputs/outputs with interleaved multiplication and symmetric quantization on the outputs.
| [in] | in_vec | pointer of the input vector |
| [in] | wt_mat | pointer of the weight matrix |
| [in] | size | number of elements in the input vector |
| [in] | wt_row_num | number of rows in the weight matrix |
| [in] | pre_rshift | right shift amount for the output |
| [in] | out_scale | value of scaling for the output |
| [in] | post_rshift | right shift amount for the output |
| [out] | out_vec | pointer of the output vector |
| [in] | in_tmp_buf | temporary buffer for input vector. It is required when -mext-vector is enabled and its size must be 2 * size. |
| int32_t bias |
#include <middleware/hpm_math/hpm_math.h>
| int32_t bias_lshift |
#include <middleware/hpm_math/hpm_math.h>
| int32_t in_tmp_buf |
#include <middleware/hpm_math/hpm_math.h>
| int32_t out_rshift |
#include <middleware/hpm_math/hpm_math.h>
| int32_t out_vec |
#include <middleware/hpm_math/hpm_math.h>
| int32_t wt_mat |
#include <middleware/hpm_math/hpm_math.h>
| int32_t wt_row_num |
#include <middleware/hpm_math/hpm_math.h>