Skip to content

Commit ba5f3f1

Browse files
committed
empty set
1 parent 01bd2dc commit ba5f3f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

onnx_array_api/profiling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ def align_text(text, size):
281281
return text[:h] + "..." + text[-h + 1 :]
282282

283283
dicts = self.as_dict(filter_node=filter_node, sort_key=sort_key)
284-
max_nc = max(max(_["nc1"] for _ in dicts), max(_["nc2"] for _ in dicts))
284+
set1 = [_["nc1"] for _ in dicts]
285+
set2 = [_["nc1"] for _ in dicts]
286+
if set1 or set2:
287+
max_nc = max([*set1, *set2])
288+
else:
289+
max_nc = 1
285290
dg = int(math.log(max_nc) / math.log(10) + 1.5)
286291
line_format = (
287292
"{indent}{fct} -- {nc1: %dd} {nc2: %dd} -- {tin:1.5f} {tall:1.5f}"

0 commit comments

Comments
 (0)