def _default_save_signature(self):
        """For SavedModel support: returns the default serving signature."""

        from keras.src.models.functional import Functional
        from keras.src.models.model import Model
        from keras.src.models.sequential import Sequential

        if not isinstance(self, Model):
            return None

        inputs = None
        if (
            isinstance(self, Sequential)
            and getattr(self, "_functional", None) is not None
        ):
            inputs = self._functional.input
        elif isinstance(self, Functional):
            inputs = self.input

        if inputs is not None:
            input_signature = (
                tree.map_structure(
                    lambda x: tf.TensorSpec(x.shape, x.dtype), inputs
                ),
            )
        else:
            input_signature = tuple(
                tree.map_shape_structure(
                    lambda s: tf.TensorSpec(s, self.input_dtype), value
                )
                for value in self._build_shapes_dict.values()
            )

        @tf.function(input_signature=input_signature)
        def serving_default(inputs):
            return self(inputs)

        return serving_default
For SavedModel support: returns the default serving signature.
keras/src/backend/tensorflow/layer.py