def compute_qparams(
    weight: np.ndarray,
    nbits: int,
    signed: bool,
    quantization_mode: str,
    dtype: np.dtype,  # Unused parameter for backward compatibility.
    block_sizes: List[int],
) -> Optional[Tuple[np.ndarray, np.ndarray, Optional[np.ndarray]]]:
    """
    Compress the given weight matrix by quantizing the weights.
    Provide different configurations of quantization by specifying a ``block_sizes`` which
    is a list containing the block size for each dimension of the weight or 0 otherwise.

    Note that per-tensor, per-channel, channelwise-grouped and per-block are
    just variants of specifying the block sizes for each dimension.
    """
    dtype = types.get_nbits_int_builtin_type(nbits, signed)
    return compute_qparams_by_dtype(weight, dtype, quantization_mode, block_sizes)

    Compress the given weight matrix by quantizing the weights.
    Provide different configurations of quantization by specifying a ``block_sizes`` which
    is a list containing the block size for each dimension of the weight or 0 otherwise.

    Note that per-tensor, per-channel, channelwise-grouped and per-block are
    just variants of specifying the block sizes for each dimension.
    
coremltools/optimize/_utils.py