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 _assert_input_compatibility(self, inputs):
      try:
          tree.assert_same_structure(
              inputs, self._inputs_struct, check_types=False
          )
      except ValueError:
          raise ValueError(
              "Function was called with an invalid input structure. "
              f"Expected input structure: {self._inputs_struct}\n"
              f"Received input structure: {inputs}"
          )
      for x, x_ref in zip(tree.flatten(inputs), self._inputs):
          if len(x.shape) != len(x_ref.shape):
              raise ValueError(
                  f"{self.__class__.__name__} was passed "
                  f"incompatible inputs. For input '{x_ref.name}', "
                  f"expected shape {x_ref.shape}, but received "
                  f"instead a tensor with shape {x.shape}."
              )
          for dim, ref_dim in zip(x.shape, x_ref.shape):
              if ref_dim is not None and dim is not None:
                  if dim != ref_dim:
                      raise ValueError(
                          f"{self.__class__.__name__} was passed "
                          f"incompatible inputs. For input '{x_ref.name}', "
                          f"expected shape {x_ref.shape}, but received "
                          f"instead a tensor with shape {x.shape}."
                      )
  
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 8 for calling the Function obj's underlying member method code with example usage: obj._assert_input_compatibility(inputs) without return types