Commit Graph

3 Commits

Author SHA1 Message Date
Advait Jain ecf05497a9
Remove support for big-endian in the TFLM inference code. (#689)
Moving forward, we will require that the endianness of the flatbuffer is
the same as the endianness of the system that TFLM is being used for
inference on.

BUG=Fixes #304 and http://b/194224890
2021-11-17 11:42:30 -08:00
Shlomi Regev 2791785562
Check for the case where the Operators vector in a tflite model is missing (#245)
* Check for the case where the Operators vector in a tflite model is missing

Some of our tools remove the vector if it's empty (i.e. the subgraph doesn't contain ops). The check is added until the tools are fixed.

BUG=http://b/192589496

* Move NumSubgraphOperators to flatbuffer_utils.h/cc

* Fix the CI errors.

* Remove `#define FLATBUFFERS_LOCALE_INDEPENDENT 0`

We will handle that via the Makefile instead.

* Add  -DFLATBUFFERS_LOCALE_INDEPENDENT=0 to makefile.

* remove references to flatbuffer from kernel_utils.cc/h

* Fix the build.

* run buildifier

Co-authored-by: Advait Jain <advaitjain@google.com>
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-07-09 21:47:29 +00:00
Shlomi Regev d25b267865
Provide a lightweight version of flexbuffers::Vector (#243)
- Save ~4KB of RAM by implementing a lightweight version of the vector, which only accesses integer values, without implicit conversion.
- Change Micro kernels to access flexbuffers as vectors instead of maps, which is recommended by the flexbuffers doc for efficiency. Since the values in the vector are ordered alphabetically by their keys, the kernels can access them by index instead.
- Revert detection_postprocess to the native flexbuffers API. The
LiteVector API doesn't support IsNull() and I prefer not to support two
custom flexbuffer APIs.

Co-authored-by: Nat Jeffries <natmjeffries@gmail.com>
2021-07-08 23:45:01 +00:00