mirror of
https://github.com/vee1e/tflite-micro.git
synced 2026-09-04 03:07:50 +00:00
feat(compression): add SpecBuilder for programmatic compression specs (#3133)
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>
This commit is contained in:
parent
41a9c8a6c3
commit
bbf70db499
5 changed files with 239 additions and 1 deletions
|
|
@ -61,6 +61,10 @@ def compression_test():
|
|||
# with compressible tensors, but we verify the function is importable
|
||||
assert callable(compression.compress)
|
||||
|
||||
# Test availability of the SpecBuilder
|
||||
_ = (compression.SpecBuilder().add_tensor(
|
||||
subgraph=0, tensor=0).with_lut(index_bitwidth=4).build())
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue