def _convert_optimum_format_to_desired(qweight, scales, qzeros, inplace=True):
    """
    Optimum format:
        qweight: (math.ceil(IC / comp_ratio), OC)
        scales: (n_groups, OC)
        qzeros: (n_groups, math.ceil(OC / comp_ratio))
        qzeros are substracted by 1 before packing

    Desired format:
        compression_dim = 1
        qweight: (OC, math.ceil(IC / comp_ratio))
        scales: (OC, n_groups)
        qzeros: (OC, math.ceil(n_groups / comp_ratio))

    Note:
        IC = input channels or input features
        OC = output channels or output features
        n_groups = math.ceil(IC / group_size)
        comp_ratio = compression data type bits // weight or zeros data type bits
        E.g., compression dtype = int32, weight dtype = int4, comp_ratio = 32 / 4 = 8

    """
    if qweight is None:
        return qweight, scales, qzeros
    oc = qweight.shape[1]
    assert oc == scales.shape[1]
    qweight = qweight.t_().contiguous() if inplace else qweight.t().contiguous()
    scales, zp = _convert_gptq_scales_qzeros(scales, qzeros, inplace)

    return qweight, scales, zp

    Optimum format:
        qweight: (math.ceil(IC / comp_ratio), OC)
        scales: (n_groups, OC)
        qzeros: (n_groups, math.ceil(OC / comp_ratio))
        qzeros are substracted by 1 before packing

    Desired format:
        compression_dim = 1
        qweight: (OC, math.ceil(IC / comp_ratio))
        scales: (OC, n_groups)
        qzeros: (OC, math.ceil(n_groups / comp_ratio))

    Note:
        IC = input channels or input features
        OC = output channels or output features
        n_groups = math.ceil(IC / group_size)
        comp_ratio = compression data type bits // weight or zeros data type bits
        E.g., compression dtype = int32, weight dtype = int4, comp_ratio = 32 / 4 = 8

    
intel_extension_for_pytorch/nn/utils/_model_convert.py