def _infer_lut_shape(
    indices_shape: Tuple[int, ...], block_sizes: Tuple[int, ...], nbits: int, vector_size: int
):
    """Infer the shape of look-up-table (LUT)."""
    lut_shape = []
    for axis, dim_size in enumerate(indices_shape):
        lut_dim_size = 1 if block_sizes[axis] == 0 else dim_size // block_sizes[axis]
        lut_shape.append(lut_dim_size)
    lut_shape.extend([2**nbits, vector_size])
    return lut_shape
Infer the shape of look-up-table (LUT).
coremltools/converters/mil/mil/ops/tests/iOS18/test_compression.py