Commit b17bb64
committed
feat(compression): implement model_editor for TFLite model manipulation
Implement unified module for creating, reading, and modifying TFLite
models with a clean API. The module eliminates manual index tracking
and buffer management through automatic bookkeeping, supporting both
declarative and imperative construction styles.
Core design uses first-class Buffer objects that can be shared between
tensors, with automatic deduplication during build. Tensors reference
Buffers directly, matching the TFLite schema structure. The compiler
automatically extracts inline tensor declarations, builds operator code
tables, and handles index assignment according to TFLite conventions.
Supports quantization parameters (per-tensor and per-channel), metadata
key-value pairs, and read-modify-write workflows. The read() function
preserves the object graph structure, enabling models to be read,
modified, and rebuilt.
Add comprehensive test coverage for core functionality, advanced
features, quantization, and modification workflows.1 parent 9cbf6e0 commit b17bb64
File tree
3 files changed
+1314
-0
lines changed- tensorflow/lite/micro/compression
3 files changed
+1314
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
240 | 262 | | |
241 | 263 | | |
242 | 264 | | |
| |||
0 commit comments