def blockwise_compress(
        cls,
        original_data: np.ndarray,
        nbits: int,
        mode: str,
        signed: bool,
        block_sizes: List[int],
    ) -> Optional["optimize_utils.QuantParams"]:
        """
        Compress original_data into n-bit representation by quantization.

        mode: "LINEAR_SYMMETRIC" or "LINEAR".

        block_sizes: Each element is the block size on corresponding axis for original_data.

        Returns None if the weight cannot be compressed (for example, the dim size on an axis is not
        divisible by the corresponding block_size).
        """
        dtype = types.get_nbits_int_builtin_type(nbits, signed)
        return cls.blockwise_compress_by_dtype(original_data, dtype, mode, block_sizes)

        Compress original_data into n-bit representation by quantization.

        mode: "LINEAR_SYMMETRIC" or "LINEAR".

        block_sizes: Each element is the block size on corresponding axis for original_data.

        Returns None if the weight cannot be compressed (for example, the dim size on an axis is not
        divisible by the corresponding block_size).
        
coremltools/optimize/coreml/_quantization_passes.py