|
arm_cmsis_nn_status | arm_nn_lstm_calculate_gate_s16 (const int16_t *data_in, const int16_t *hidden_in, const cmsis_nn_lstm_gate *gate, const cmsis_nn_lstm_params *params, int16_t *output, const int32_t batch_offset) |
| Updates a LSTM gate for an iteration step of LSTM function, int16x8_16 version.
|
|
arm_cmsis_nn_status | arm_nn_lstm_calculate_gate_s8_s16 (const int8_t *data_in, const int8_t *hidden_in, const cmsis_nn_lstm_gate *gate, const cmsis_nn_lstm_params *params, int16_t *output, const int32_t batch_offset) |
| Updates a LSTM gate for an iteration step of LSTM function, int8x8_16 version.
|
|
arm_cmsis_nn_status | arm_nn_lstm_step_s16 (const int16_t *data_in, const int16_t *hidden_in, int16_t *hidden_out, const cmsis_nn_lstm_params *params, cmsis_nn_lstm_context *buffers, const int32_t batch_offset) |
| Update LSTM function for an iteration step using s16 input and output, and s16 internally.
|
|
arm_cmsis_nn_status | arm_nn_lstm_step_s8 (const int8_t *data_in, const int8_t *hidden_in, int8_t *hidden_out, const cmsis_nn_lstm_params *params, cmsis_nn_lstm_context *buffers, const int32_t batch_offset) |
| Update LSTM function for an iteration step using s8 input and output, and s16 internally.
|
|
arm_cmsis_nn_status | arm_nn_vec_mat_mul_result_acc_s8_s16 (const int8_t *lhs, const int8_t *rhs, const int32_t *effective_bias, int16_t *dst, const int32_t dst_multiplier, const int32_t dst_shift, const int32_t rhs_cols, const int32_t rhs_rows, const int32_t batches, const int32_t batch_offset) |
| The result of the multiplication is accumulated to the passed result buffer. Multiplies a matrix by a "batched" vector (i.e. a matrix with a batch dimension composed by input vectors independent from each other).
|
|
Support functions for LSTM
◆ arm_nn_lstm_calculate_gate_s16()
Updates a LSTM gate for an iteration step of LSTM function, int16x8_16 version.
- Parameters
-
[in] | data_in | Data input pointer |
[in] | hidden_in | Hidden state/ recurrent input pointer |
[in] | gate_data | Struct containing all information about the gate caluclation, see arm_nn_types. |
[in] | params | Struct containing all information about the lstm_operation, see arm_nn_types |
[out] | output | Hidden state/ recurrent output pointer |
[in] | batch_offset | Number of timesteps between consecutive batches, see arm_nn_lstm_step_s16. |
- Returns
- The function returns ARM_CMSIS_NN_SUCCESS
◆ arm_nn_lstm_calculate_gate_s8_s16()
Updates a LSTM gate for an iteration step of LSTM function, int8x8_16 version.
- Parameters
-
[in] | data_in | Data input pointer |
[in] | hidden_in | Hidden state/ recurrent input pointer |
[in] | gate_data | Struct containing all information about the gate caluclation, see arm_nn_types. |
[in] | params | Struct containing all information about the lstm_operation, see arm_nn_types |
[out] | output | Hidden state/ recurrent output pointer |
[in] | batch_offset | Number of timesteps between consecutive batches, see arm_nn_lstm_step_s8. |
- Returns
- The function returns ARM_CMSIS_NN_SUCCESS
◆ arm_nn_lstm_step_s16()
Update LSTM function for an iteration step using s16 input and output, and s16 internally.
- Parameters
-
[in] | data_in | Data input pointer |
[in] | hidden_in | Hidden state/ recurrent input pointer |
[out] | hidden_out | Hidden state/ recurrent output pointer |
[in] | params | Struct containg all information about the lstm operator, see arm_nn_types. |
[in] | buffers | Struct containg pointers to all temporary scratch buffers needed for the lstm operator, see arm_nn_types. |
[in] | batch_offset | Number of timesteps between consecutive batches. E.g for params->timing_major = true, all batches for t=0 are stored sequentially, so batch offset = 1. For params->time major = false, all time steps are stored continously before the next batch, so batch offset = params->time_steps. |
- Returns
- The function returns ARM_CMSIS_NN_SUCCESS
◆ arm_nn_lstm_step_s8()
Update LSTM function for an iteration step using s8 input and output, and s16 internally.
- Parameters
-
[in] | data_in | Data input pointer |
[in] | hidden_in | Hidden state/ recurrent input pointer |
[out] | hidden_out | Hidden state/ recurrent output pointer |
[in] | params | Struct containg all information about the lstm operator, see arm_nn_types. |
[in] | buffers | Struct containg pointers to all temporary scratch buffers needed for the lstm operator, see arm_nn_types. |
[in] | batch_offset | Number of timesteps between consecutive batches. E.g for params->timing_major = true, all batches for t=0 are stored sequentially, so batch offset = 1. For params->time major = false, all time steps are stored continously before the next batch, so batch offset = params->time_steps. |
- Returns
- The function returns ARM_CMSIS_NN_SUCCESS
◆ arm_nn_vec_mat_mul_result_acc_s8_s16()
arm_cmsis_nn_status arm_nn_vec_mat_mul_result_acc_s8_s16 |
( |
const int8_t * |
lhs, |
|
|
const int8_t * |
rhs, |
|
|
const int32_t * |
effective_bias, |
|
|
int16_t * |
dst, |
|
|
const int32_t |
dst_multiplier, |
|
|
const int32_t |
dst_shift, |
|
|
const int32_t |
rhs_cols, |
|
|
const int32_t |
rhs_rows, |
|
|
const int32_t |
batches, |
|
|
const int32_t |
batch_offset |
|
) |
| |
The result of the multiplication is accumulated to the passed result buffer. Multiplies a matrix by a "batched" vector (i.e. a matrix with a batch dimension composed by input vectors independent from each other).
- Parameters
-
[in] | lhs | Batched vector |
[in] | rhs | Weights - input matrix (H(Rows)xW(Columns)) |
[in] | effective_bias | Bias + lhs_offset * kernel_sum term precalculated into a constant vector. |
[out] | dst | Output |
[in] | dst_multiplier | Multiplier for quantization |
[in] | dst_shift | Shift for quantization |
[in] | rhs_cols | Vector/matarix column length |
[in] | rhs_rows | Row count of matrix |
[in] | batches | Batch size |
[in] | batch_offset | Number of timesteps between consecutive batches in input, see arm_nn_lstm_step_s8. Note that the output is always stored with sequential batches. |
- Returns
- The function returns
ARM_CMSIS_NN_SUCCESS