Add a fluent builder API for creating compression specifications
without writing YAML strings. This is useful in scripts and
Jupyter notebooks.
Example usage:
spec = (compression.SpecBuilder()
.add_tensor(subgraph=0, tensor=2)
.with_lut(index_bitwidth=4)
.build())
BUG=#3125
Co-authored-by: suleshahid <110432064+suleshahid@users.noreply.github.com>
feat(python): add compression module to tflite_micro Python package
Integrate the TFLM compression tools into the tflite_micro Python
package, allowing users to compress models directly from Python code
that imports the package.
Usage:
from tflite_micro import compression
Details:
- Add compress_lib py_library target in compression BUILD
- Create compression package with __init__.py exposing public API
- Include compression module in Python package dependencies
- Add compression dependencies to wheel requirements
BUG=see description
Add the build configuration and integrated test to generate a Python
distribution package named `tflite_micro` for publishing the tflm interpreter
as a Python module with a native extension.
Use the build tools provided in @rules_python, augmented by a custom rule
`py_namespace` for the reasons documented in `python/py_namespace.bzl`.
Provide an integration test at `//python/tflite_micro:whl_test`. Use a .tflite
model copied from the hello_world example. (Copied to avoid creating a
dependency.)
BUG=part of #1484