apps_mlearning_tflite-micro/tensorflow/lite
Xie Lin 12699e7952 Tflm: Add per-channel quantization support to FULLY_CONNECTED operator
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>
2026-04-20 14:48:10 +08:00
..
c Automated sync from github.com/tensorflow/tensorflow (#2308) 2026-04-20 14:47:54 +08:00
core Compile mechanism base. 2026-04-20 14:48:03 +08:00
experimental/microfrontend Microfrontend warnings (#2296) 2026-04-20 14:47:53 +08:00
kernels Automated sync from github.com/tensorflow/tensorflow (#2445) 2026-04-20 14:48:00 +08:00
micro Tflm: Add per-channel quantization support to FULLY_CONNECTED operator 2026-04-20 14:48:10 +08:00
python Replace tensorflow-cpu usage with tensorflow (#2396) 2026-04-20 14:48:01 +08:00
schema Automated sync from github.com/tensorflow/tensorflow (#2307) 2026-04-20 14:47:54 +08:00
tools Replace tensorflow-cpu usage with tensorflow (#2396) 2026-04-20 14:48:01 +08:00
BUILD build(bazel): use --std=c++17 by default (#2060) 2023-06-15 20:22:54 +00:00
array.cc Sync from upstream TF. (#2053) 2023-06-14 23:27:57 +00:00
array.h Automated sync from github.com/tensorflow/tensorflow (#2080) 2023-06-26 07:52:25 +00:00
build_def.bzl build: Add -Wno-unused-parameter to bazel build (#2237) 2023-09-21 02:23:53 +00:00
builtin_op_data.h Sync from upstream TF. (#1594) 2022-11-25 22:26:48 -08:00
builtin_ops.h Automated sync from github.com/tensorflow/tensorflow (#2251) 2023-09-29 16:09:38 +00:00
context_util.h Automated sync from github.com/tensorflow/tensorflow 2022-11-30 17:07:11 +00:00
portable_type_to_tflitetype.h Sync from upstream TF. (#1594) 2022-11-25 22:26:48 -08:00