keras/src/layers/reshaping/flatten.py/Flatten/compute_output_spec
class Flatten:    def compute_output_spec(self, inputs):
        output_shape = self.compute_output_shape(inputs.shape)
        return KerasTensor(
            shape=output_shape, dtype=inputs.dtype, sparse=inputs.sparse
        )