Public Member Functions | |
| template<typename T> | |
| void | constrain_scale (T &scale) const noexcept |
| Keep learned scales in the numerically safe, strictly-positive range. | |
| template<typename T> | |
| void | constrain_zero_point (T &zero_point) const noexcept |
| template<typename T> | |
| void | constrain_parameters (T *scales, T *zero_points) const noexcept |
| Project all learned parameters into this backend quantization scheme. | |
Static Public Member Functions | |
| static constexpr Int8Quantization | activation () noexcept |
| Per-tensor asymmetric activation quantization. | |
| static constexpr Int8Quantization | weights (std::size_t axis_size, std::size_t inner_size) noexcept |
LiteRT/CMSIS-NN/Ethos-U signed int8 quantization layout.
|
inlinestaticconstexprnoexcept |
Per-tensor asymmetric activation quantization.
|
inlinenoexcept |
Project all learned parameters into this backend quantization scheme.
| T | Quantization parameter scalar type. |
| [in,out] | scales | Array of parameter_count() learned scales. |
| [in,out] | zero_points | Array of parameter_count() learned zero-points. |
|
inlinenoexcept |
Keep learned scales in the numerically safe, strictly-positive range.
| T | Scale scalar type. |
| [in,out] | scale | Learned scale to constrain. |
|
inlinenoexcept |
Keep learned zero-points in this scheme's integer domain. Symmetric weight quantization always forces them to zero.
| T | Zero-point scalar type. |
| [in,out] | zero_point | Learned zero-point to constrain. |
|
inlinestaticconstexprnoexcept |
Symmetric per-axis weight quantization.
| axis_size | Number of scales along the quantized axis. |
| inner_size | Product of dimensions following the quantized axis. |
axis_size is the number of scales and inner_size is the product of the dimensions following the quantized axis in a row-major tensor. Thus a fully-connected [output, input] matrix uses (output, input), Conv2D OHWI uses (output, H*W*I), and depthwise Conv2D uses (channels, 1).