aboutsummaryrefslogtreecommitdiff
path: root/python/scripts/report-model-ops/README.md
blob: aa8efa88d3501a943ddec9eed6c05e7dbc11ac2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Extract list of operators from a list of TfLite models

## Introduction

Purpose of this script is to inspect a list of user-provided TfLite models and report
the list of operators that are used as well as the data-types that the models operate on.
The script can subsequently generate a configuration file that can be provided to the
Compute Library build system and generate a library that contains only the operators required
by the given model(s) to run.

Utilizing this script, use-case tailored Compute Library dynamic libraries can be created,
helping reduce the overall binary size requirements.

## Usage example

Assuming that the virtual environment is activated and the requirements are present,
we can run the following command:

```bash
./report_model_ops.py -m modelA.tfile modelB.tflite -c build_config.json
```

## Input arguments

***models (required)*** :
A list of comma separated model files.

Supported model formats are:

* TfLite

***config (optional)*** :
The configuration file to be created on JSON format that can be provided to ComputeLibrary's
build system and generate a library with the given list of operators and data-types

***debug (optional)*** :
Flag that enables debug information