class_docstr: The ModelGraph represents the network that is being processed by hls4ml.
  
  Args:
      config (dict):  The configuration dictionary
      layer_list (list(dict)):  The list contains a dictionary for each input layer
      inputs (list, optional):  The inputs to the model. If None, determined from layer_list
      outputs (list, optional):  The outputs to the model. If None, determined from layer_list
docstr: Remove a node from a graph.
  
  By default, this function can connect the outputs of previous node to the input of next one.
  Note that when removing a leaf node `rewire` should be set to `False`.
  
  Args:
      node (Layer): The node to remove
      rewire (bool, optional): If `True`, connects the outputs of the previous node
          to the inputs of the next node
  
  Raises:
      Exception: If an attempt is made to rewire a leaf node or a node with multiple
          inputs/outputs.
docstr_tok: ["Remove","a","node","from","a","graph",".","By","default",",","this","function","can","connect","the","outputs","of","previous","node","to","the","input","of","next","one",".","Note","that","when","removing","a","leaf","node","`","rewire","`","should","be","set","to","`","False","`",".","Args",":","node","(","Layer",")",":","The","node","to","remove","rewire","(","bool",",","optional",")",":","If","`","True","`",",","connects","the","outputs","of","the","previous","node","to","the","inputs","of","the","next","node","Raises",":","Exception",":","If","an","attempt","is","made","to","rewire","a","leaf","node","or","a","node","with","multiple","inputs\/outputs","."]
code: def remove_node(self, node, rewire=True):
      """Remove a node from a graph.
  
      By default, this function can connect the outputs of previous node to the input of next one.
      Note that when removing a leaf node `rewire` should be set to `False`.
  
      Args:
          node (Layer): The node to remove
          rewire (bool, optional): If `True`, connects the outputs of the previous node
              to the inputs of the next node
  
      Raises:
          Exception: If an attempt is made to rewire a leaf node or a node with multiple
              inputs/outputs.
  
      """
      if rewire:
          inputs = [inp for inp in node.inputs if inp]
          outputs = [outp for outp in node.outputs if outp]
          if len(inputs) > 1 or len(outputs) > 1:
              raise Exception(
                  "Cannot rewire a node with multiple inputs/outputs"
              )
          prev_node = node.get_input_node(node.inputs[0])
          next_nodes = [
              x
              for x in self.graph.values()
              if node.outputs[0] in x.inputs
          ]
          if prev_node is not None:
              if len(next_nodes) > 0:
                  for next_node in next_nodes:
                      for i, _ in enumerate(next_node.inputs):
                          if node.outputs[0] == next_node.inputs[i]:
                              next_node.inputs[i] = prev_node.outputs[0]
                              break
              else:
                  if not node.outputs[0] in self.outputs:
                      raise Exception(
                          "Cannot rewire a node without child"
                      )
          else:
              raise Exception("Cannot rewire a node without a parent")
  
      del self.output_vars[node.outputs[0]]
      del self.graph[node.name]
      self._update_model_outputs()
  
imports: import ctypes
  import os
  import platform
  from collections import OrderedDict
  import numpy
  import numpy.ctypeslib
  from hls4ml.backends import get_backend
  from hls4ml.model.flow import get_flow
  from hls4ml.model.layers import layer_map
  from hls4ml.model.optimizer import get_available_passes, optimize_model
label_desc: Use image node_id 8 for calling the ModelGraph obj's underlying member method code with example usage: obj.remove_node(node, rewire) without return types