Function arm_svdf_state_s16_s8

Function Documentation

arm_cmsis_nn_status arm_svdf_state_s16_s8(const cmsis_nn_context *input_ctx, const cmsis_nn_context *output_ctx, const cmsis_nn_svdf_params *svdf_params, const cmsis_nn_per_tensor_quant_params *input_quant_params, const cmsis_nn_per_tensor_quant_params *output_quant_params, const cmsis_nn_dims *input_dims, const int8_t *input_data, const cmsis_nn_dims *state_dims, int16_t *state_data, const cmsis_nn_dims *weights_feature_dims, const int8_t *weights_feature_data, const cmsis_nn_dims *weights_time_dims, const int16_t *weights_time_data, const cmsis_nn_dims *bias_dims, const int32_t *bias_data, const cmsis_nn_dims *output_dims, int8_t *output_data)

s8 SVDF function with 16 bit state tensor and 16 bit time weights

  1. Supported framework: TensorFlow Lite micro

Parameters:
  • input_ctx[in]

    Scratch buffer written by this function, holding one int32_t accumulator per (input batch, feature batch). Written before it is read, so its contents on entry do not matter, but it is written on EVERY build, not only under MVE. Mandatory: a NULL buf is diagnosed with ARM_CMSIS_NN_ARG_ERROR on every build. Sized by arm_svdf_state_s16_s8_input_ctx_get_buffer_size(input_dims,

    weights_feature_dims): input_dims->n * weights_feature_dims->n * sizeof(int32_t) bytes, the same figure on every build target. Note the accumulators are int32_t even though the state tensor is int16_t - this buffer does not shrink with the state width. This function does not read input_ctx->size, so an undersized buffer is not diagnosed: query the sizer above and honour it. The caller is expected to clear the buffer, if applicable, for security reasons.

  • output_ctx[in]

    Scratch buffer written by this function, holding one int32_t accumulator per (input batch, output unit). Written before it is read, so its contents on entry do not matter, but it is written on EVERY build, not only under MVE. Mandatory: a NULL buf is diagnosed with ARM_CMSIS_NN_ARG_ERROR on every build. Sized by arm_svdf_state_s16_s8_output_ctx_get_buffer_size(svdf_params,

    input_dims, weights_feature_dims): input_dims->n * (weights_feature_dims->n / svdf_params->rank) * sizeof(int32_t) bytes, truncating division, the same figure on every build target. This function does not read output_ctx->size, so an undersized buffer is not diagnosed: query the sizer above and honour it. The caller is expected to clear the buffer, if applicable, for security reasons.

  • svdf_params[in] SVDF Parameters Range of svdf_params->input_offset : [-128, 127] Range of svdf_params->output_offset : [-128, 127]

  • input_quant_params[in] Input quantization parameters

  • output_quant_params[in] Output quantization parameters

  • input_dims[in] Input tensor dimensions

  • input_data[in] Pointer to input tensor

  • state_dims[in] State tensor dimensions

  • state_data[in] Pointer to state tensor

  • weights_feature_dims[in] Weights (feature) tensor dimensions

  • weights_feature_data[in] Pointer to the weights (feature) tensor

  • weights_time_dims[in] Weights (time) tensor dimensions

  • weights_time_data[in] Pointer to the weights (time) tensor

  • bias_dims[in] Bias tensor dimensions

  • bias_data[in] Pointer to bias tensor

  • output_dims[in] Output tensor dimensions

  • output_data[out] Pointer to the output tensor

Returns:

The function returns ARM_CMSIS_NN_SUCCESS