Skip to content

Commit

Permalink
add check for no inputs in insert_node (fastmachinelearning#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmitrevs authored Jan 22, 2025
1 parent 267c0c2 commit c408145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hls4ml/model/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def insert_node(self, node, before=None, input_idx=0):
next_nodes.append(x)

if before is None:
next_node = next((x for x in self.graph.values() if x.inputs[0] in prev_node.outputs), None)
next_node = next((x for x in self.graph.values() if x.inputs and x.inputs[0] in prev_node.outputs), None)
else:
if before not in next_nodes:
raise Exception(
Expand Down

0 comments on commit c408145

Please sign in to comment.