Skip to content

Commit c408145

Browse files
authored
add check for no inputs in insert_node (#1170)
1 parent 267c0c2 commit c408145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hls4ml/model/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def insert_node(self, node, before=None, input_idx=0):
494494
next_nodes.append(x)
495495

496496
if before is None:
497-
next_node = next((x for x in self.graph.values() if x.inputs[0] in prev_node.outputs), None)
497+
next_node = next((x for x in self.graph.values() if x.inputs and x.inputs[0] in prev_node.outputs), None)
498498
else:
499499
if before not in next_nodes:
500500
raise Exception(

0 commit comments

Comments
 (0)