From 58a65fee574c00329cf92b387a6d2513dcbf6100 Mon Sep 17 00:00:00 2001 From: Dmitrii Agibov Date: Mon, 24 Oct 2022 15:08:08 +0100 Subject: MLIA-433 Add TensorFlow Lite compatibility check - Add ability to intercept low level TensorFlow output - Produce advice for the models that could not be converted to the TensorFlow Lite format - Refactor utility functions for TensorFlow Lite conversion - Add TensorFlow Lite compatibility checker Change-Id: I47d120d2619ced7b143bc92c5184515b81c0220d --- src/mlia/core/reporters.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/mlia/core/reporters.py (limited to 'src/mlia/core') diff --git a/src/mlia/core/reporters.py b/src/mlia/core/reporters.py new file mode 100644 index 0000000..de73ad7 --- /dev/null +++ b/src/mlia/core/reporters.py @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +"""Reports module.""" +from __future__ import annotations + +from mlia.core.advice_generation import Advice +from mlia.core.reporting import Column +from mlia.core.reporting import Report +from mlia.core.reporting import Table + + +def report_advice(advice: list[Advice]) -> Report: + """Generate report for the advice.""" + return Table( + columns=[ + Column("#", only_for=["plain_text"]), + Column("Advice", alias="advice_message"), + ], + rows=[(i + 1, a.messages) for i, a in enumerate(advice)], + name="Advice", + alias="advice", + ) -- cgit v1.2.1