Function arm_clamp_s16

Function Documentation

arm_cmsis_nn_status arm_clamp_s16(const int16_t *input, const int16_t act_min, const int16_t act_max, int16_t *output, const int32_t output_size)

S16 clamp function.

This function clamps each element in the input tensor to the range. This can be useful for activations such as relu(0, 6), relu(-1,1), etc.

Parameters:
  • input[in] Pointer to input

  • act_min[in] Minimum value to clamp to

  • act_max[in] Maximum value to clamp to

  • output[out] Pointer to output

  • output_size[in] Number of elements in the tensor

Returns:

The function returns ARM_CMSIS_NN_SUCCESS