keras/src/layers/preprocessing/discretization.py/Discretization/finalize_state
class Discretization:    def finalize_state(self):
        if self.input_bin_boundaries is not None:
            return
        self.bin_boundaries = get_bin_boundaries(
            self.summary, self.num_bins
        ).tolist()