TensorFlow Lite Micro Init#
The TensorFlow Lite Micro Init functions are autogenerated from the flatbuffer file provided in the configuration, which includes an opsResolver generated according to the included operators in the flatbuffer.
Helper functions to access the input and output tensors are also provided.
Functions#
Estimate the arena size for a given model.
Dynamically allocate a buffer that can be used for the tensor arena.
Get a pointer to the TensorFlow Lite Micro error reporter created by the init function.
Get a pointer to the TensorFlow Lite Micro interpreter created by the init function.
Get a pointer to the input tensor, set by the init function.
Get a pointer to the output tensor, set by the init function.
Get a pointer to the opcode resolver for the flatbuffer given by the configuration.
Create the error reporter and opcode resolver and initialize variables for the flatbuffer given by the configuration.
Function Documentation#
sl_tflite_micro_estimate_arena_size#
sl_status_t sl_tflite_micro_estimate_arena_size (const tflite::Model * model, const tflite::MicroOpResolver & opcode_resolver, size_t * estimated_size)
Estimate the arena size for a given model.
[in] | model | Pointer to the model to estimate the arena size for. |
[in] | opcode_resolver | The opcode resolver to use for the model. |
[out] | estimated_size | The estimated size of the arena, as output. |
Returns
SL_STATUS_OK if the estimation was successful.
58
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_allocate_tensor_arena#
uint8_t * sl_tflite_micro_allocate_tensor_arena (size_t arena_size, uint8_t ** tensor_arena)
Dynamically allocate a buffer that can be used for the tensor arena.
[in] | arena_size | The size of the arena to allocate. |
[out] | tensor_arena | Pointer to the allocated tensor arena buffer. |
Returns
A pointer to the allocated base buffer. Returns nullptr if the allocation failed. The base buffer is used for freeing the allocated memory.
68
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_get_error_reporter#
tflite::ErrorReporter * sl_tflite_micro_get_error_reporter ()
Get a pointer to the TensorFlow Lite Micro error reporter created by the init function.
Returns
A pointer to the error reporter.
77
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_get_interpreter#
tflite::MicroInterpreter * sl_tflite_micro_get_interpreter ()
Get a pointer to the TensorFlow Lite Micro interpreter created by the init function.
Returns
A pointer to the interpreter.
87
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_get_input_tensor#
TfLiteTensor * sl_tflite_micro_get_input_tensor ()
Get a pointer to the input tensor, set by the init function.
Returns
A pointer to the input tensor.
96
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_get_output_tensor#
TfLiteTensor * sl_tflite_micro_get_output_tensor ()
Get a pointer to the output tensor, set by the init function.
Returns
A pointer to the output tensor.
105
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_opcode_resolver#
tflite::MicroOpResolver & sl_tflite_micro_opcode_resolver ()
Get a pointer to the opcode resolver for the flatbuffer given by the configuration.
Returns
The address to the opcode resolver.
114
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h
sl_tflite_micro_init#
void sl_tflite_micro_init (void )
Create the error reporter and opcode resolver and initialize variables for the flatbuffer given by the configuration.
N/A |
126
of file util/third_party/tensorflow_extra/inc/sl_tflite_micro_init.h