def remove_node(self, node_name: str):
        """Remove a node from the graph.

        :param node_name: name of the node to remove. Node should not have consumers.
        """
        if node_name not in self.nodes:
            raise ValueError(f"Node {node_name} does not exist in the graph.")

        if self.connections[node_name]:
            raise ValueError(f"Node {node_name} has consumers.")

        node = self.nodes.pop(node_name)

        # remove node from the connections
        for i in node.inputs:
            if i == "":
                # some nodes have unnamed, unused inputs
                continue
            self.ios[i].destination.remove(node_name)
            parent = self.ios[i].source
            if parent not in [SpecialInput.INPUT, SpecialInput.INITIALIZER]:
                self.connections[parent].remove(node_name)

        for o in node.outputs:
            if o == "":
                # some nodes have unnamed, unused outputs
                continue
            del self.ios[o]

        del self.connections[node_name]
Remove a node from the graph.

        :param node_name: name of the node to remove. Node should not have consumers.
        
olive/passes/onnx/onnx_dag.py