You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TFLM currently shares several headers and source files with LiteRT (tensorflow/lite/... and tensorflow/compiler/mlir/lite/...), relying on #ifdef TF_LITE_STATIC_MEMORY to strip mobile & desktop-only code and struct fields. This causes ODR/header collisions when linking both runtimes in the same binary and forces both projects to maintain TF_LITE_STATIC_MEMORY.
We are decoupling TFLM into a completely standalone codebase under tensorflow/lite/micro/ that shares only schema.fbs (tensorflow/lite/schema/schema.fbs) with LiteRT:
Step 1 (Mostly standalone TFLM #3671): Move tensorflow/lite/kernels/internal/** and C++ kernel helpers (RuntimeShape, reference_ops, quantization_util, kernel_util) into tensorflow/lite/micro/ under namespace tflite::micro (with namespace tflite compatibility aliases).
Step 2 (Decouple C API from LiteRT #3788): Move C API headers and sources (common.h, common.cc, c_api_types.h, builtin_op_data.h) into tensorflow/lite/micro/c/ while temporarily keeping TF_LITE_STATIC_MEMORY and forwarding headers in tensorflow/lite/{core/,}c/ for downstream migration.
Step 3 (Remove tensorflow/compiler/ and tensorflow/lite/{c,core,kernels}):
Move schema.fbs to tensorflow/lite/schema/schema.fbs and schema_utils.{h,cc} into tensorflow/lite/micro/.
Move flatbuffer_conversions.{h,cc} into tensorflow/lite/micro/tflite_bridge/ under namespace tflite::micro and replace TF_LITE_REPORT_ERROR with MicroPrintf.
Merge macros.h into tensorflow/lite/micro/kernels/internal/compatibility_macros.h.
Replace test-only IntArrayUniquePtr usage in micro_allocator_test.cc with IntArrayFromInts, delete tensorflow/lite/micro/array.{h,cc}, and remove TfLiteIntArrayCreate/Free and TfLiteFloatArrayCreate/Free from tensorflow/lite/micro/c/common.{h,cc}.
Give tensorflow/lite/micro/c/*.h dedicated TENSORFLOW_LITE_MICRO_C_*_H_ header guards and move C API types/functions into namespace tflite::micro (with global-namespace aliases when LiteRT's common.h is not included).
Remove #ifndef TF_LITE_STATIC_MEMORY blocks, -DTF_LITE_STATIC_MEMORY build flags, and test_x86_no_tflite_static_memory.sh.
TFLM currently shares several headers and source files with LiteRT (
tensorflow/lite/...andtensorflow/compiler/mlir/lite/...), relying on#ifdef TF_LITE_STATIC_MEMORYto strip mobile & desktop-only code and struct fields. This causes ODR/header collisions when linking both runtimes in the same binary and forces both projects to maintainTF_LITE_STATIC_MEMORY.We are decoupling TFLM into a completely standalone codebase under
tensorflow/lite/micro/that shares onlyschema.fbs(tensorflow/lite/schema/schema.fbs) with LiteRT:tensorflow/lite/kernels/internal/**and C++ kernel helpers (RuntimeShape,reference_ops,quantization_util,kernel_util) intotensorflow/lite/micro/undernamespace tflite::micro(withnamespace tflitecompatibility aliases).common.h,common.cc,c_api_types.h,builtin_op_data.h) intotensorflow/lite/micro/c/while temporarily keepingTF_LITE_STATIC_MEMORYand forwarding headers intensorflow/lite/{core/,}c/for downstream migration.tensorflow/compiler/andtensorflow/lite/{c,core,kernels}):schema.fbstotensorflow/lite/schema/schema.fbsandschema_utils.{h,cc}intotensorflow/lite/micro/.flatbuffer_conversions.{h,cc}intotensorflow/lite/micro/tflite_bridge/undernamespace tflite::microand replaceTF_LITE_REPORT_ERRORwithMicroPrintf.macros.hintotensorflow/lite/micro/kernels/internal/compatibility_macros.h.error_reporter.{h,cc},micro_error_reporter.{h,cc},tensor_utils.{h,cc},context_util.h,tensorflow/lite/array.{h,cc}), forwarding headers (tensorflow/lite/{core/,}c/,tensorflow/lite/kernels/),tensorflow/compiler/, andci/sync_from_upstream_tf.sh.array.{h,cc}helpers):IntArrayUniquePtrusage inmicro_allocator_test.ccwithIntArrayFromInts, deletetensorflow/lite/micro/array.{h,cc}, and removeTfLiteIntArrayCreate/FreeandTfLiteFloatArrayCreate/Freefromtensorflow/lite/micro/c/common.{h,cc}.tensorflow/lite/micro/c/& removeTF_LITE_STATIC_MEMORY):tensorflow/lite/micro/c/*.hdedicatedTENSORFLOW_LITE_MICRO_C_*_H_header guards and move C API types/functions intonamespace tflite::micro(with global-namespace aliases when LiteRT'scommon.his not included).#ifndef TF_LITE_STATIC_MEMORYblocks,-DTF_LITE_STATIC_MEMORYbuild flags, andtest_x86_no_tflite_static_memory.sh.