Improve Synet quantized API documentation - #374
Merged
Conversation
Co-authored-by: Ihar Yermalayeu <ermig1979@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the public C API documentation for Synet quantized/activation/conversion functions in SimdLib.h to better reflect current implementation behavior, and records these documentation improvements in the 2026 changelog.
Changes:
- Expanded Doxygen descriptions and added algorithm/pseudocode snippets for multiple Synet quantized and activation APIs in
src/Simd/SimdLib.h. - Added corresponding “Description of function …” entries to
docs/2026.html.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Simd/SimdLib.h | Updates Doxygen docs for Synet quantized/activation/conversion APIs, including new algorithm details. |
| docs/2026.html | Adds 2026 “Improving” entries documenting the API doc updates. |
Comment on lines
+9579
to
+9581
| The current implementation supports equal input shapes. For each element it dequantizes UINT8 inputs | ||
| as (value - zero)*scale, adds the two values, applies activation if it is specified and converts the | ||
| result to FP32 or UINT8 output. FP32 inputs and outputs ignore the corresponding quantization zero. |
| \param [in] bType - a type of input B tensor. It can be ::SimdTensorData32f or ::SimdTensorData8u. | ||
| \param [in] bScale - a pointer to quantization scale of input B tensor. Can be NULL (scale is 1.0). | ||
| \param [in] bZero - a quantization zero of input B tensor. | ||
| \param [in] actType - an activation function type applied after addition. Supported optimized path uses ::SimdConvolutionActivationIdentity or ::SimdConvolutionActivationRelu. |
| \short Performs forward propagation of quantized addition algorithm. | ||
| \short Performs element-wise quantized addition. | ||
|
|
||
| Algorithm's details for UINT8 output: |
Comment on lines
+9636
to
+9640
| for(n = 0; n < num; ++n) | ||
| for(s = 0, offset = 0; s < count; offset += size[s], ++s) | ||
| for(i = 0; i < size[s]; ++i) | ||
| dst[offset + i] = RestrictRange(Round((src[s][n*size[s] + i] + bias[s])*norm[s]*scale[0]) + zero, 0, 255); | ||
| \endverbatim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SimdLib.hDoxygen descriptions for Synet quantized add, concat, convolution, inner product, merged convolution, activation, scale, shuffle, quantize, input conversion and softmax APIs based on current implementation behavior.docs/2026.html.Testing
git diff --checkdocs/2026.html.SimdLib.hnon-comment content is unchanged.Full test suite was not run per request.