Commit graph

2 commits

Author SHA1 Message Date
Ryan Kuester
b5da836410
refactor(python): move runtime to package-friendly directory structure (#2051)
To package the module `runtime` as `tflite_micro.runtime`, put `runtime` under
a directory representing the Python namespace package `tflite_micro`. For
organization's sake, move it all to the top-level directory `python/`. Adjust
tests and docs to match.

Some code outside of the Python extension module has come to depend on
`python/tflite_micro:python_ops_resolver` as a replacement for
`all_ops_resolver` (e.g.:`t/l/m/integration_tests/seanet/add/integration_tests.cc`).
`python_ops_resolver` is intended to be a private implementation detail of the
Python extension module. For now, grandfather in the dependent code by updating
its references to the resolver's location; however, soon the dependent code
should be migrated away to a different resolver. (#2033,
https://issuetracker.google.com/286508251)

BUG=part of #1484
2023-06-15 06:25:19 +00:00
Pauline Sho
90d62ab628
Implement Python interpreter for TFLM (#1147)
* First pass working with float input/output

* Numpy buffer input works. Got a sine graph for hello world output.

Copyright notice

* Remove static references

* Output tensors work

* Output tensors work

* bazel test works

bazel test tensorflow/lite/micro/tools:interpreter_test
--test_output=all

* Successfully built extension with Python setuptools

cd tensorflow/lite/micro/tools/interpreter_pypi
python -m build
pip install dist/example_tflm_interpreter_psho-0.0.3-cp39-cp39-linux_x86_64.whl --force-reinstall
python tests/test-interpreter.py

TestPyPi:
pip uninstall example-tflm-interpreter-psho
python -m twine upload --repository testpypi dist/example-tflm-interpreter-psho-0.0.3.tar.gz
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple example-tflm-interpreter-psho==0.0.3
python tests/test-interpreter.py

* Refactored some

* Cleaned for production and tested with conv model

* Fixed formatting

* Fixed numpy header issue for Docker. Need to fix double registration issue that's somehow only present in Docker.

* Test fix with changes in ci.yml

* Added sudo

* Added nomsan and noasan tags to python test

* Added -layering-check, used py_library instead of py_binary to generate conv model, added micro namespace

* Removed extra debug code

* Added new tests

* Changed reinterpret_steal to cast

* Addressed PR comments

* size log refactor (#1156)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Addressed PR and review comments

* adding documentation to log_binary* workflows. (#1161)

* Automated binary size log update (#1160)

* Create an allocator to manage persistent arena (#1174)

* Create an allocator to manage persistent arena

This PR corresponds to internal cl/452380512.

Create an allocator to manage persistent arena.
This is another step towards the feature of enabling the client to
have two separate memory arenas.

BUG=https://b/226971240

* Manually patch due to Makefile difference

* Fix virtual environment when building Vela for Arm Ethos-U (#1177)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Removed print statement

Co-authored-by: jwithers <jpwithers@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: TFLM-bot <tflm-github-bot@google.com>
Co-authored-by: deqiangc <86809673+deqiangc@users.noreply.github.com>
Co-authored-by: Måns Nilsson <mans.nilsson@arm.com>
2022-06-03 19:09:54 +00:00