keras/src/layers/layer.py/Layer/_assert_input_compatibility
class Layer:    def _assert_input_compatibility(self, arg_0):
        if self.input_spec:
            input_spec.assert_input_compatibility(
                self.input_spec, arg_0, layer_name=self.name
            )