20#include <mio/tflite/schema_generated.h>
31 std::vector<T> ret(flat_array->
size());
32 for (uint32_t i = 0; i < flat_array->
size(); i++)
34 ret[i] = flat_array->
Get(i);
51 Reader(
const tflite::Model *model);
56 const std::vector<const tflite::OperatorCode *> &
opcodes() {
return _op_codes; }
60 const std::vector<int32_t> &
inputs()
const {
return _inputs; }
61 const std::vector<int32_t> &
outputs()
const {
return _outputs; }
65 size_t buffer_info(uint32_t buf_idx,
const uint8_t **buff_data);
66 tflite::BuiltinOperator
builtin_code(
const tflite::Operator *op)
const;
67 std::string
opcode_name(
const tflite::Operator *op)
const;
73 const TFliteSubGraphs_t *_subgraphs{
nullptr};
74 const TFliteBuffers_t *_buffers{
nullptr};
75 const TFliteTensors_t *_tensors{
nullptr};
76 const TFliteOperators_t *_operators{
nullptr};
78 std::vector<const tflite::OperatorCode *> _op_codes;
79 std::vector<int32_t> _inputs;
80 std::vector<int32_t> _outputs;
return_type Get(uoffset_t i) const
Loads TF lite file and provides helpers to access attributes.
bool select_subgraph(uint32_t subgraph)
const TFliteBuffers_t * buffers()
const TFliteOperators_t * operators()
const std::vector< int32_t > & outputs() const
tflite::BuiltinOperator builtin_code(const tflite::Operator *op) const
const TFliteTensors_t * tensors()
uint32_t num_subgraph() const
const std::vector< int32_t > & inputs() const
size_t buffer_info(uint32_t buf_idx, const uint8_t **buff_data)
const std::vector< const tflite::OperatorCode * > & opcodes()
std::string opcode_name(const tflite::Operator *op) const
std::vector< T > as_index_vector(const flatbuffers::Vector< T > *flat_array)