aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNina Drozd <nina.drozd@arm.com>2020-08-28 17:14:49 +0100
committerNina Drozd <nina.drozd@arm.com>2020-09-01 16:31:03 +0000
commitf737c678da7c8e4bf23dc7e7bfdb55407d64dd7c (patch)
treec618c66132abdf7d3e1eb8f9214d1649eda44b2c /python
parentec36d3ee6619f1e777aa82c694ee2ec0433fc770 (diff)
downloadarmnn-f737c678da7c8e4bf23dc7e7bfdb55407d64dd7c.tar.gz
MLECO-1226: update pyarmnn profiling helper utility
* fix key error in get_profiling_data * make retrieval of inference measurements more generic Signed-off-by: Nina Drozd <nina.drozd@arm.com> Change-Id: I3fc147a6a93830b59e8b12f517be9f9c72370c09
Diffstat (limited to 'python')
-rw-r--r--python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py b/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py
index c6e0718722..ecde040d81 100644
--- a/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py
+++ b/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py
@@ -53,8 +53,11 @@ def get_profiling_data(profiler: 'IProfiler') -> ProfilerData:
top_level_dict = json.loads(profiler.as_json())
armnn_data = top_level_dict["ArmNN"]
- inference_measurements = armnn_data["inference_measurements_#1"]
- execution_data = inference_measurements["Execute_#2"]
+ #Get the inference measurements dict, this will be just one value for key starting with "inference_measurements"
+ inference_measurements = [v for k, v in armnn_data.items() if k.startswith("inference_measurements_")][0]
+
+ #Get the execution data dict, this will be just one value for key starting with "Execute_"
+ execution_data = [v for k, v in inference_measurements.items() if k.startswith("Execute_")][0]
workload_data = {}
inference_data = {}