This commit fixes the inference accuracy issue in tflite-micro by adding per-channel quantization support to the FULLY_CONNECTED operator. Root Cause: - The fork only supported per-tensor quantization (single scale/zero_point for entire weight tensor) - Upstream added per-channel quantization (independent scale/zero_point per output channel) which provides better accuracy Changes: 1. tensorflow/lite/micro/kernels/fully_connected.h - Added is_per_channel flag - Added per_channel_output_multiplier array - Added per_channel_output_shift array 2. tensorflow/lite/micro/kernels/fully_connected_common.cc - Updated quantization parameter calculation to support per-channel 3. tensorflow/lite/micro/kernels/fully_connected.cc - Added conditional execution path for per-channel quantization - Preserved TFLITE_MODEL_COMPILER customization Signed-off-by: Xie Lin <xielin3@xiaomi.com> |
||
|---|---|---|
| .. | ||
| lite | ||
| BUILD | ||
| extra_rules.bzl | ||
| workspace.bzl | ||