TfliteMicroAccelerator

class TfliteMicroAccelerator[source]

TF-Lite Micro Accelerator

This class allows for providing hardware-accelerated kernels to the TFLM interpreter.

Properties

accelerator_wrapper

Return the TfliteMicroAcceleratorWrapper instance

api_version

The API version number this wrapper was built with This number must match the tflite_micro_wrapper's API version

git_hash

Return the GIT hash of the YZLITE repo used to compile the wrapper library

name

The name of the accelerator

supports_model_compilation

Return if this accelerator supports model compilation

Methods

__init__

compile_model

Compile the given .tflite model and return a new TfliteModel instance with the compiled data

enable_data_recorder

Enable the accelerator data recorder

enable_program_recorder

Enable the accelerator instruction recorder

estimate_profiling_results

Update the given ProfilingModelResults with estimated model metrics

__init__(accelerator_wrapper)[source]
property name: str

The name of the accelerator

Return type:

str

property api_version: int

The API version number this wrapper was built with This number must match the tflite_micro_wrapper’s API version

Return type:

int

property git_hash: int

Return the GIT hash of the YZLITE repo used to compile the wrapper library

Return type:

int

property accelerator_wrapper

Return the TfliteMicroAcceleratorWrapper instance

property supports_model_compilation: bool

Return if this accelerator supports model compilation

Return type:

bool

estimate_profiling_results(results, **kwargs)[source]

Update the given ProfilingModelResults with estimated model metrics

Parameters:

results (ProfilingModelResults) –

enable_program_recorder()[source]

Enable the accelerator instruction recorder

enable_data_recorder()[source]

Enable the accelerator data recorder

compile_model(model, logger=None, report_path=None, **kwargs)[source]

Compile the given .tflite model and return a new TfliteModel instance with the compiled data

NOTE: The accelerator must support model compilation to use this API

Return type:

TfliteModel

Parameters:
  • model (TfliteModel) –

  • logger (Optional[Logger]) –

  • report_path (Optional[str]) –