class_docstr: Class that encapsulates a computation graph of Keras operations.
  
  You can use a `Function` to capture the computation graph linking
  some input tensors to some output tensors, and reapply the same
  computation on new inputs.
  
  A `Function` is similar to a Functional Model, with the difference
  that it is stateless (it does not track state variables)
  and does not implement the `Layer` API.
  
  Example:
  
  ```python
  input_1 = keras.KerasTensor(shape=(None, 2, 3))
  input_2 = keras.KerasTensor(shape=(None, 2, 3))
  x = input_1 + input_2
  output = keras.ops.sigmoid(x)
  fn = keras.Function(inputs=[input_1, input_2], outputs=output)
  
  input_1_val = np.random.random((4, 2, 3))
  input_2_val = np.random.random((4, 2, 3))
  output_val = fn([input_1_val, input_2_val])
  ```
  
  Args:
      inputs: `KerasTensor` instance or nested structured of
          `KerasTensor` instances.
      outputs: `KerasTensor` instance or nested structured of
          `KerasTensor` instances. They should be computable
          given only the values of `inputs`.
      name: String. The name of the function.
class_docstr_tok: ["Class","that","encapsulates","a","computation","graph","of","Keras","operations",".","You","can","use","a","`","Function","`","to","capture","the","computation","graph","linking","some","input","tensors","to","some","output","tensors",",","and","reapply","the","same","computation","on","new","inputs",".","A","`","Function","`","is","similar","to","a","Functional","Model",",","with","the","difference","that","it","is","stateless","(","it","does","not","track","state","variables",")","and","does","not","implement","the","`","Layer","`","API",".","Example",":","``","`","python","input_1","=","keras.KerasTensor","(","shape=","(","None",",","2",",","3",")",")","input_2","=","keras.KerasTensor","(","shape=","(","None",",","2",",","3",")",")","x","=","input_1","+","input_2","output","=","keras.ops.sigmoid","(","x",")","fn","=","keras.Function","(","inputs=","[","input_1",",","input_2","]",",","outputs=output",")","input_1_val","=","np.random.random","(","(","4",",","2",",","3",")",")","input_2_val","=","np.random.random","(","(","4",",","2",",","3",")",")","output_val","=","fn","(","[","input_1_val",",","input_2_val","]",")","``","`","Args",":","inputs",":","`","KerasTensor","`","instance","or","nested","structured","of","`","KerasTensor","`","instances",".","outputs",":","`","KerasTensor","`","instance","or","nested","structured","of","`","KerasTensor","`","instances",".","They","should","be","computable","given","only","the","values","of","`","inputs","`",".","name",":","String",".","The","name","of","the","function","."]
code: def __init__(self, inputs, outputs, name=None):
      super().__init__(name=name)
  
      if backend() == "tensorflow":
          # Temporary work around for
          # https://github.com/keras-team/keras/issues/931
          # This stop tensorflow from wrapping tf.function output in a
          # _DictWrapper object.
          _self_setattr_tracking = getattr(
              self, "_self_setattr_tracking", True
          )
          self._self_setattr_tracking = False
      self._inputs_struct = tree.map_structure(lambda x: x, inputs)
      self._outputs_struct = tree.map_structure(lambda x: x, outputs)
      self._inputs = tree.flatten(inputs)
      self._outputs = tree.flatten(outputs)
      if not self._inputs:
          raise ValueError(
              "`inputs` argument cannot be empty. Received:\n"
              f"inputs={inputs}\n"
              f"outputs={outputs}"
          )
      if not self._outputs:
          raise ValueError(
              "`outputs` argument cannot be empty. Received:\n"
              f"inputs={inputs}\n"
              f"outputs={outputs}"
          )
  
      if backend() == "tensorflow":
          self._self_setattr_tracking = _self_setattr_tracking
  
      (
          nodes,
          nodes_by_depth,
          operations,
          operations_by_depth,
      ) = map_graph(self._inputs, self._outputs)
      self._nodes = nodes
      self._nodes_by_depth = nodes_by_depth
      self._operations = operations
      self._operations_by_depth = operations_by_depth
  
imports: import collections
  import tree
  from keras.api_export import keras_export
  from keras.backend import KerasTensor
  from keras.backend.config import backend
  from keras.ops.operation import Operation
  from keras.utils.nest import pack_sequence_as
label_desc: Use image node_id 1 to create a new Function object from inherited base classes: Operation with example: obj = Function(inputs, outputs, name)