Update graph insert/remove/replace
Created by: thesps
- In
remove_node
, when the node being removed is an output node, the model outputs need to be reconnected to the input of the removed node. - In
remove_node
, we raise an exception that we cannot handle nodes with multiple outputs (nor inputs). However, even for a node with a single output, that output may be consumed my multiple other nodes. So I've added a loop over nodes connected to that output, reconnecting them to the removed node's input whereas previously only one node would have been reconnected - Rather than
replace_node
duplicating that logic, I've modified it to useinsert_node
thenremove_node
directly.