def _generate_lut(shape: Tuple[int, ...]):
        """It follows the MIL test cases."""
        total_num = np.prod(shape)
        lut = np.arange(min(total_num, 128))
        if total_num > lut.size:
            lut = np.concatenate((lut, np.ones(total_num - lut.size) * 127))
        return lut.reshape(shape)
It follows the MIL test cases.
coremltools/converters/mil/mil/ops/tests/iOS18/test_compression.py