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
* 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>
- 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>