Skip to content

Commit b94eb3f

Browse files
committed
Avoid recursion error in profiling
1 parent e002bf4 commit b94eb3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onnx_array_api/profiling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def _get_root(node, stor=None):
7373
stor.append(node)
7474
if not node.called_by:
7575
return node
76-
if len(node.called_by) == 1:
77-
return _get_root(node.called_by[0], stor=stor)
76+
if len(node.called_by) == 0:
77+
return None
7878
res = None
7979
for ct in node.called_by:
8080
k = id(node), id(ct)

0 commit comments

Comments
 (0)