mltk.core.tflite_micro.tflite_micro_accelerator.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

active_variant

The name of the variant actively being used by this accelerator

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 MLTK repo used to compile the wrapper library

name

The name of the accelerator

supports_model_compilation

Return if this accelerator supports model compilation

variants

List of variants supported by this accelerator

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

estimate_profiling_results

Update the given ProfilingModelResults with estimated model metrics

set_program_recorder_enabled

Enable the accelerator instruction recorder

__init__(accelerator_wrapper)[source]
property name: str

The name of the accelerator

Return type:

str

property variants: List[str]

List of variants supported by this accelerator

Return type:

List[str]

property active_variant: str

The name of the variant actively being used by this 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: str

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

Return type:

str

property accelerator_wrapper: object

Return the TfliteMicroAcceleratorWrapper instance

Return type:

object

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

set_program_recorder_enabled(enabled)[source]

Enable the accelerator instruction recorder

Parameters:

enabled (bool) –

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 (Logger) –

  • report_path (str) –