From 65366066e1da4afbeb5acec27dd1080b08a34a51 Mon Sep 17 00:00:00 2001 From: Lucas Wilkinson Date: Tue, 24 Oct 2023 16:01:49 -0400 Subject: [PATCH] fix csv export not exporting kernel shapes (#1344) Co-authored-by: Lucas Wilkinson --- src/deepsparse/debug_analysis.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/deepsparse/debug_analysis.py b/src/deepsparse/debug_analysis.py index 1a7c25b2c3..85ca633446 100644 --- a/src/deepsparse/debug_analysis.py +++ b/src/deepsparse/debug_analysis.py @@ -463,15 +463,14 @@ def flatten(parent_k, sub_d): } for li in result["layer_info"] ] + col_keys = {k for li in csv_layer_infos for k in li.keys()} # Export results import csv print("Saving analysis results to CSV file at {}".format(args.export_path)) with open(args.export_path, "w") as out: - writer = csv.DictWriter( - out, fieldnames=csv_layer_infos[0].keys(), extrasaction="ignore" - ) + writer = csv.DictWriter(out, fieldnames=col_keys, extrasaction="ignore") writer.writeheader() for data in csv_layer_infos: writer.writerow(data)