chromium/third_party/tflite_support/README.chromium

Name: TensorFlow Lite Support
Short Name: tflite-support
URL: https://github.com/tensorflow/tflite-support
Version: d3a8a112e5d3f83696e665f76f660f2b5dd47052
Revision: d3a8a112e5d3f83696e665f76f660f2b5dd47052
Date: 2023-09-27
License: Apache 2.0
License File: LICENSE
Security Critical: Yes
Shipped: yes
CPEPrefix: unknown

Description:
TFLite Support is a toolkit that helps users to develop ML and deploy TFLite
models onto mobile devices.  It works cross-Platform and is supported on
Java, C++ (WIP), and Swift (WIP).

Third party dependencies:
- tflite
- libzip
- utf
- tensorflow-text

Local modifications with their associated descriptions are contained in the
patches/ subdirectory.

Update process:

1) First, update Chrome's copy from the main tflite support repository:
   ```
   pushd third_party/tflite_support/
   rm -rf src/
   git clone https://github.com/tensorflow/tflite-support/ src
   rm -rf src/.git/
   git add src
   popd
   git commit -m "Initial roll."
   ```
2) Apply the patches in patches/:
   ```
   git am --keep-cr third_party/tflite_support/patches/*
   ```
3) This works somewhat like a rebase, and conflicts may need to be resolved
   along the way.
4) If additional patches are needed, record each distinct patch as its own git
   commit. A reasonably-sized patch would be "delete component <X> which is not
   used in Chrome". A patch named "fix the build for Chrome" would probably be
   too generic and large.
5) Regenerate the patches/ subdirectory:
   ```
   git rm third_party/tflite_support/patches/*
   git format-patch HEAD -<number of changes> -o third_party/tflite_support/patches
   git add third_party/tflite_support/patches/*
   ```

Important: do not proceed to the next steps until all local patches have been
updated and applied!

6) Remove the testdata directory, which contains many large binary artifacts:
   ```
   git rm -r third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata
   ```
   This is not tracked as a patchfile, as `git format-patch` can generate very
   large diffs for this.