aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/stats_writer.py
diff options
context:
space:
mode:
authorDiego Russo <diego.russo@arm.com>2020-04-14 18:41:58 +0100
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commitea6111a36e55501bbfb9ea022aaf8305b4d80183 (patch)
treef6787f7d07ea56a502616a8d6f36bc9c7e6e4efe /ethosu/vela/stats_writer.py
parent2213e90570af328418d4f4a0d54269ed21dc40bc (diff)
downloadethos-u-vela-ea6111a36e55501bbfb9ea022aaf8305b4d80183.tar.gz
Add pre-commit support for sanity checks
Use pre-commit framework [1] to run black and flake8 before the commit. black and flake8 are managed by the pre-commit framework and they can be run manually by the user using `pre-commit run` command. Fix the code base with the help of black and flake8. Fix import statements according to PEP8 guidelines [1] Both tools have the following settings (specified in the pre-commit configuration file): * line length: 120 characters * directory to exclude: ethosu/vela/tflite/ and ethosu/vela/ethos_u55_regs Updated README.md on how to install pre-commit and how to run sanity checks. Pipenv files have been updated including new dependencies for pre-commit. [1]: https://www.python.org/dev/peps/pep-0008/#imports [2]: https://github.com/pre-commit/pre-commit Change-Id: I304d9fffdf019d390ffa396a529c8a7c2437f63d Signed-off-by: Diego Russo <diego.russo@arm.com>
Diffstat (limited to 'ethosu/vela/stats_writer.py')
-rw-r--r--ethosu/vela/stats_writer.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ethosu/vela/stats_writer.py b/ethosu/vela/stats_writer.py
index c4b4cd9e..3fd29d12 100644
--- a/ethosu/vela/stats_writer.py
+++ b/ethosu/vela/stats_writer.py
@@ -18,12 +18,15 @@
# Description:
# Writes out per-pass and summary performance statistics to CSV files.
+import csv
+import sys
+
import numpy as np
-from .nn_graph import MemArea, TensorPurpose, PassPlacement
+
+from .tensor import MemArea, TensorPurpose
+from .nn_graph import PassPlacement
from .npu_performance import PassCycles, MacCount, BandwidthDirection
-import csv
from .numeric_util import round_up_to_int
-import sys
def write_summary_metrics_csv(nng, summary_filename, arch):
@@ -246,7 +249,7 @@ def print_performance_metrics_for_strat(
print(file=f)
for mem_area, label in mem_area_labels:
- if not mem_area in memory_used:
+ if mem_area not in memory_used:
continue
aug_label = label + " used"