keras/src/layers/preprocessing/category_encoding.py/CategoryEncoding/compute_output_shape
class CategoryEncoding:    def compute_output_shape(self, input_shape):
        if (input_shape is not None) & (len(input_shape) == 0):
            return (self.num_tokens,)
        if self.output_mode == "one_hot":
            if input_shape[-1] != 1:
                return tuple(input_shape + (self.num_tokens,))
            elif len(input_shape) == 1:
                return tuple(input_shape + (self.num_tokens,))
            else:
                return tuple(input_shape[:-1] + (self.num_tokens,))
        return tuple(input_shape[:-1] + (self.num_tokens,))