Function arm_add_s16¶
Defined in File arm_nnfunctions.h
Function Documentation¶
-
arm_cmsis_nn_status arm_add_s16(const int16_t *input1_data, const cmsis_nn_dims *input1_dims, const int16_t *input2_data, const cmsis_nn_dims *input2_dims, const int32_t input1_offset, const int32_t input1_mult, const int32_t input1_shift, const int32_t input2_offset, const int32_t input2_mult, const int32_t input2_shift, const int32_t left_shift, int16_t *output_data, const cmsis_nn_dims *output_dims, const int32_t out_offset, const int32_t out_mult, const int32_t out_shift, const int32_t out_activation_min, const int32_t out_activation_max)¶
s16 elementwise add of two tensors with support for broadcasting.
- Parameters:
input1_data – [in] pointer to input tensor 1
input1_dims – [in] pointer to input tensor 1 dimensions
input2_data – [in] pointer to input tensor 2
input2_dims – [in] pointer to input tensor 2 dimensions
input1_offset – [in] offset for input 1. Range: -127 to 128
input1_mult – [in] multiplier for input 1
input1_shift – [in] shift for input 1
input2_offset – [in] offset for input 2. Range: -127 to 128
input2_mult – [in] multiplier for input 2
input2_shift – [in] shift for input 2
left_shift – [in] left shift applied to the result. Bound: the kernel evaluates value << left_shift in int32; the offsets are unused, so with full-range int16 inputs the extremes are +32767 and -32768, and -32768 << 16 is exactly INT32_MIN, which makes 16 the last shift that stays representable. The scale 1 << left_shift is itself representable up to 30. Not validated by the kernel.
output_data – [out] pointer to output tensor
output_dims – [in] pointer to output tensor dimensions
out_offset – [in] output offset. Range: -128 to 127
out_mult – [in] output multiplier
out_shift – [in] output shift
out_activation_min – [in] minimum value to clamp output to. Min: -128
out_activation_max – [in] maximum value to clamp output to. Max: 127
- Returns:
ARM_CMSIS_NN_SUCCESS on success, or ARM_CMSIS_NN_ARG_ERROR when a pointer is NULL, a dimension is not positive, the two input shapes are not broadcast-compatible, or the output shape is not their broadcast shape.