def load_qconf_summary_to_model(model, qconf_summary):
    """
    This function is about load the user given configure to origin model.
    """
    with open(qconf_summary, "r") as f:
        quant_state_dict = json.load(f)
    quant_state_map = model._fqn_to_auto_quant_state_map
    for k, v in quant_state_map.items():
        layer_info = quant_state_dict[k]
        user_q_op_infos = layer_info["q_op_infos"]
        for i, q_op_info in user_q_op_infos.items():
            fqn = q_op_info["fqn"]
            cur_fqn = v.idx_to_seen_q_op_infos[int(i)].fqn
            assert (
                int(i) in v.idx_to_seen_q_op_infos and cur_fqn == fqn
            ), "Loaded quantizable op info doesn't match the current model quantizable op info"
            input_tensor_infos = []
            input_force_dtype_infos = []
            for tensor_info in q_op_info["input_tensor_infos"]:
                if len(tensor_info) > 0:
                    input_tensor_infos.append(
                        QTensorInfo(
                            tensor_info["id"],
                            dtype_dict[tensor_info["orig_dtype"]],
                            dtype_dict[tensor_info["inf_dtype"]],
                        )
                    )
                    input_force_dtype_infos.append(
                        dtype_dict[tensor_info["force_dtype"]]
                    )
                    if "scale" in tensor_info:
                        if isinstance(tensor_info["scale"], list):
                            scale = torch.FloatTensor(tensor_info["scale"])
                            zp = torch.LongTensor(tensor_info["zero_point"])
                        else:
                            scale, zp = {}, {}
                            scale_to_load = tensor_info["scale"]
                            zp_to_load = tensor_info["zero_point"]
                            assert isinstance(scale_to_load, dict) and isinstance(
                                zp_to_load, dict
                            ), (
                                "Expect scales and zero points to load are dicts but "
                                f"found types {type(scale_to_load)} and {type(zp_to_load)}"
                            )
                            for key, val in scale_to_load.items():
                                s = torch.FloatTensor(val)
                                scale.update({key: s})
                            for key, val in zp_to_load.items():
                                z = torch.LongTensor(val)
                                zp.update({key: z})
                        v.tensor_id_to_scale_zp[tensor_info["id"]] = (scale, zp)
                    if "smooth_quant_scaling_factor" in tensor_info:
                        scaling_factors = {}
                        scaling_factors_to_load = tensor_info[
                            "smooth_quant_scaling_factor"
                        ]
                        if isinstance(scaling_factors_to_load, dict):
                            for key, val in scaling_factors_to_load.items():
                                scaling_factor = torch.FloatTensor(val)
                                scaling_factors.update({key: scaling_factor})
                        else:
                            # for backward compatibility
                            assert isinstance(scaling_factors_to_load, list), (
                                f"Expect scaling factors to load to be a dict or list "
                                f"but found type {type(scaling_factors_to_load)}"
                            )
                            scaling_factor = torch.FloatTensor(scaling_factors_to_load)
                            dummy_weight_key = "0_0"
                            scaling_factors.update({dummy_weight_key: scaling_factor})
                        v.tensor_id_to_smooth_quant_scaling_factor[
                            str(tensor_info["id"])
                        ] = scaling_factors
                else:
                    input_tensor_infos.append(None)
                    input_force_dtype_infos.append(None)
            weight_tensor_infos = []
            weight_idx = 0
            for tensor_info in q_op_info["weight_tensor_infos"]:
                if len(tensor_info) > 0:
                    weight_tensor_infos.append(
                        QTensorInfo(
                            weight_idx,
                            dtype_dict[tensor_info["orig_dtype"]],
                            dtype_dict[tensor_info["inf_dtype"]],
                        )
                    )
                    if "scale" in tensor_info:
                        scale = torch.FloatTensor(tensor_info["scale"])
                        zp = torch.LongTensor(tensor_info["zero_point"])
                        v.weight_tensor_id_to_scale_zp[
                            str(i) + "_" + str(weight_idx)
                        ] = (scale, zp)
                    if "smooth_quant_scaling_factor" in tensor_info:
                        scaling_factor = torch.FloatTensor(
                            tensor_info["smooth_quant_scaling_factor"]
                        )
                        v.weight_tensor_id_to_smooth_quant_scaling_factor[
                            str(i) + "_" + str(weight_idx)
                        ] = scaling_factor
                    weight_idx += 1
                else:
                    weight_tensor_infos.append(None)
            output_tensor_infos = []
            insert_fake_quant_after_outputs = []
            for tensor_info in q_op_info["output_tensor_infos"]:
                if len(tensor_info) > 0:
                    output_tensor_infos.append(
                        QTensorInfo(
                            tensor_info["id"],
                            dtype_dict[tensor_info["orig_dtype"]],
                            dtype_dict[tensor_info["inf_dtype"]],
                        )
                    )
                    insert_fake_quant_after_outputs.append(False)
                    if "scale" in tensor_info:
                        if isinstance(tensor_info["scale"], list):
                            scale = torch.FloatTensor(tensor_info["scale"])
                            zp = torch.LongTensor(tensor_info["zero_point"])
                        else:
                            scale, zp = {}, {}
                            scale_to_load = tensor_info["scale"]
                            zp_to_load = tensor_info["zero_point"]
                            assert isinstance(scale_to_load, dict) and isinstance(
                                zp_to_load, dict
                            ), (
                                "Expect scales and zero points to load are dicts but "
                                f"found types {type(scale_to_load)} and {type(zp_to_load)}"
                            )
                            for key, val in scale_to_load.items():
                                s = torch.FloatTensor(val)
                                scale.update({key: s})
                            for key, val in zp_to_load.items():
                                z = torch.LongTensor(val)
                                zp.update({key: z})
                        v.tensor_id_to_scale_zp[tensor_info["id"]] = (scale, zp)
                else:
                    output_tensor_infos.append(None)
            activation_observer = q_op_info["activation_observer"]
            weight_observer = q_op_info["weight_observer"]
            activation_obs = _create_observer(activation_observer)
            if isinstance(activation_obs(), SmoothQuantActivationObserver):
                share_weight_observers = q_op_info.get("share_weight_observers", True)
                qconfig = QConfigSmoothQuant(
                    activation=activation_obs,
                    weight=_create_observer(weight_observer),
                    share_weight_observers=share_weight_observers,
                )
            else:
                qconfig = QConfig(
                    activation=activation_obs,
                    weight=_create_observer(weight_observer),
                )
            # overide the cur model's info
            v.idx_to_seen_q_op_infos[int(i)].input_tensor_infos = input_tensor_infos
            v.idx_to_seen_q_op_infos[int(i)].input_tensor_force_inf_dtype = (
                input_force_dtype_infos
            )
            v.idx_to_seen_q_op_infos[int(i)].output_tensor_infos = output_tensor_infos
            v.idx_to_seen_q_op_infos[int(i)].insert_fake_quant_after_outputs = (
                insert_fake_quant_after_outputs
            )
            v.idx_to_seen_q_op_infos[int(i)].weight_tensor_infos = weight_tensor_infos
            v.idx_to_seen_q_op_infos[int(i)].qconfig = qconfig

        user_nonq_op_infos = layer_info["nonq_op_infos"]
        # v.seen_nonq_op_infos.clear()
        idx = 0
        for _, nonq_op_info in user_nonq_op_infos.items():
            fqn = nonq_op_info["fqn"]
            cur_fqn = v.seen_nonq_op_infos[idx].fqn
            assert (
                cur_fqn == fqn
            ), "Loaded none-quantizable op info doesn't match the current model none-quantizable op info"
            input_tensor_infos = []
            for tensor_info in nonq_op_info["input_tensor_infos"]:
                if len(tensor_info) > 0:
                    input_tensor_infos.append(
                        QTensorInfo(
                            tensor_info["id"],
                            dtype_dict[tensor_info["orig_dtype"]],
                            dtype_dict[tensor_info["inf_dtype"]],
                        )
                    )
                else:
                    input_tensor_infos.append(None)
            output_tensor_infos = []
            for tensor_info in nonq_op_info["output_tensor_infos"]:
                if len(tensor_info) > 0:
                    output_tensor_infos.append(
                        QTensorInfo(
                            tensor_info["id"],
                            dtype_dict[tensor_info["orig_dtype"]],
                            dtype_dict[tensor_info["inf_dtype"]],
                        )
                    )
                else:
                    output_tensor_infos.append(None)
            v.seen_nonq_op_infos[idx].input_tensor_infos = input_tensor_infos
            v.seen_nonq_op_infos[idx].output_tensor_infos = output_tensor_infos
            idx += 1

        layer_output_info = []
        for tensor_info in layer_info["layer_output_infos"]:
            if len(tensor_info) > 0:
                layer_output_info.append(
                    QTensorInfo(
                        tensor_info["id"],
                        dtype_dict[tensor_info["orig_dtype"]],
                        dtype_dict[tensor_info["inf_dtype"]],
                    )
                )
                if "scale" in tensor_info:
                    scale = torch.FloatTensor(tensor_info["scale"])
                    zp = torch.LongTensor(tensor_info["zero_point"])
                    v.tensor_id_to_scale_zp[tensor_info["id"]] = (scale, zp)
            else:
                layer_output_info.append(None)
        v.output_qtensor_infos = layer_output_info
    # insert observer according to user's setting.
    for _, v in model.named_modules():
        if hasattr(v, "_auto_quant_state"):
            v._auto_quant_state.tensor_id_to_observer.clear()
            v._auto_quant_state.weight_tensor_id_to_observer.clear()
            v._auto_quant_state.insert_observers(v)

    # update insert_fake_quant_after_output after load user setting, which for avoiding redundant fake quant.
    nodes = convert_quant_state_map_to_nodes(quant_state_map)
    set_node_output_quantized(nodes)

    This function is about load the user given configure to origin model.
    
intel_extension_for_pytorch/quantization/_utils.py