tflite: Add Fp16Eq matcher Some delegates may internally use fp16 for fp32 arithmetic, making the default EXPECT_FLOAT_EQ too strict for such cases. Since we are going to check fp16 results in many places, it would be nice for us to have a single fp16 matchers similar to EXPECT_FLOAT_EQ. This CL implements a new Fp16Eq matcher based on the implementation in tensorflow [1] to provide a more precise and easy comparison. BUG=b:374245241 TEST=bazelisk run --config='asan' -c dbg --config=host_clang '//common/test_util:fp16_compare_test' [1] https://github.com/tensorflow/tensorflow/blob/689a4291c92835bc3d7b51adb3540b87432557d0/tensorflow/lite/kernels/test_util.cc#L121-L135 Change-Id: I6660ceab524ef84cae1c6d0e98bced7c2e51b14f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tflite/+/6370771 Reviewed-by: Shik Chen <shik@chromium.org> Tested-by: Tommy Chiang <ototot@google.com> Commit-Queue: Tommy Chiang <ototot@google.com>
This repository hosts the core ChromeOS TFLite components, enabling on-device machine learning (ODML) workloads accelerated by NPU.
The corresponding ebuild can be found at: tensorflow-9999.ebuild
Patches are stored in the patch/ directory and explicitly listed in WORKSPACE.bazel. A helper script, ./script/patcher.py, is included to facilitate patch management within a TFLite workspace.
The typical workflow:
Eject (Download) TensorFlow Source Code
Download the TensorFlow source code into a local git repository with patches applied as individual commits:
./script/patcher.py eject
This creates a new local git repository at tensorflow/.
Modify the TensorFlow Repository
Make changes to the tensorflow/ repository as needed, following standard git workflows. Optionally, include a PATCH_NAME= tag in commit messages to specify the filename of the corresponding patch.
Seal the Repository
Regenerate the patch files and update the WORKSPACE.bazel file:
./script/patcher.py seal
This updates the patches in the patch/ directory and reflects the changes in WORKSPACE.bazel.
It's preferred to submit changes to upstream TensorFlow first and cherry-pick them as patches. This helps minimize divergence and makes TensorFlow updates easier.