Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing doc on arm_nn_requantize #108

Closed
ghost opened this issue Feb 19, 2024 · 0 comments · Fixed by #128
Closed

Confusing doc on arm_nn_requantize #108

ghost opened this issue Feb 19, 2024 · 0 comments · Fixed by #128
Labels
documentation Improvements or additions to documentation

Comments

@ghost
Copy link

ghost commented Feb 19, 2024

The documentation of arm_nn_requantize is

/**
 * @brief           Requantize a given value.
 * @param[in]       val         Value to be requantized
 * @param[in]       multiplier  multiplier. Range {NN_Q31_MIN + 1, Q32_MAX}
 * @param[in]       shift       left or right shift for 'val * multiplier'
 *
 * @return          Returns (val * multiplier)/(2 ^ shift)
 *
 */

But the CMSIS_USE_SINGLE_ROUNDING path does not compute that, but some rounding of (val * multipler) / (2^(shift+31))

Besides, the left or right shift part of the doc is not very clear: how to specify the direction of the shift?
It seems that it is based on the sign of shift, with positive shifts being left shift and negative shifts being right shifts.

@felix-johnny felix-johnny added the documentation Improvements or additions to documentation label Feb 27, 2024
mansnils added a commit that referenced this issue Apr 16, 2024
- Updates readmes
- Updates header for arm_nn_requantize

Fix: #108
ArmRyan pushed a commit that referenced this issue Apr 16, 2024
- Updates readmes
- Updates header for arm_nn_requantize

Fix: #108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant