def _default_recipe_init(nodes):
    r"""
    This function is about init default recipe: setting the quantizable op's inf dtype to qint8 or quint8 according the qconfig,
    there have some special cases, for some ops(interaction, EmbeddingBag), we only support some special \
    quantization path, so if the related qconfig
    doesn't meet the requirements, we will not set their inf dtype.
    """
    for node in nodes:
        if isinstance(node, ParentNode):
            continue
        if node.qconfig is not None:
            # Add q+dq before the quantizable op firstly.
            for idx, tensor_info in enumerate(node.input_tensor_infos):
                # only support fp32 tensor->int8 tensor
                if (
                    tensor_info is not None
                    and (tensor_info.orig_dtype == torch.float32)
                    and tensor_info.id in node.input_scale_zero
                ):
                    # gemm's weight
                    if node.type in conv_gemm_fs and idx == 1:
                        tensor_info.inf_dtype = node.qconfig.weight().dtype
                    else:
                        tensor_info.inf_dtype = node.qconfig.activation().dtype
                    node.input_tensor_force_inf_dtype[idx] = tensor_info.inf_dtype
            # For EmbeddingBag and interaction, we need to check the qconfig's setting, if not meet the requirements, \
            # reset the inputs'(or weight) inf dtype
            for tensor_info in node.weight_tensor_infos:
                # nn.EmbeddingBag use activation observer and only support torch.qint8 and torch.per_tensor_symmetric
                if (
                    tensor_info is not None
                    and (tensor_info.orig_dtype == torch.float32)
                    and (
                        str(node.idx) + "_" + str(tensor_info.id)
                        in node.weight_scale_zero
                    )
                ):
                    if (
                        node.type == str(torch.nn.EmbeddingBag)
                        and node.qconfig.activation().dtype == torch.qint8
                        and node.qconfig.activation().qscheme
                        == torch.per_tensor_symmetric
                    ) or node.type != str(torch.nn.EmbeddingBag):
                        tensor_info.inf_dtype = node.qconfig.weight().dtype
            # interaction only supports qint8 and torch.per_tensor_symmetric, if not meet the requirement,
            # reset the input's inf dtype.
            if node.type in s8_s8_symmetric_ops:
                if not (
                    node.qconfig.activation().dtype == torch.qint8
                    and node.qconfig.activation().qscheme == torch.per_tensor_symmetric
                ):
                    for idx, tensor_info in enumerate(node.input_tensor_infos):
                        if tensor_info is not None:
                            tensor_info.inf_dtype = tensor_info.orig_dtype
                            node.input_tensor_force_inf_dtype[idx] = (
                                tensor_info.inf_dtype
                            )

            # For LSTM, if it's input is a PackedSequence, we don't support ot now.
            # TODO: support PackedSequence input for quantization LSTM.
            if (
                node.type in rnn_ops
                and len(node.input_tensor_infos) > 2
                and node.input_tensor_infos[1].orig_dtype == torch.int64
            ):
                for idx, tensor_info in enumerate(node.input_tensor_infos):
                    if tensor_info is not None:
                        tensor_info.inf_dtype = tensor_info.orig_dtype
                        node.input_tensor_force_inf_dtype[idx] = tensor_info.inf_dtype
                for idx, tensor_info in enumerate(node.weight_tensor_infos):
                    if tensor_info is not None:
                        tensor_info.inf_dtype = tensor_info.orig_dtype

    This function is about init default recipe: setting the quantizable op's inf dtype to qint8 or quint8 according the qconfig,
    there have some special cases, for some ops(interaction, EmbeddingBag), we only support some special \
    quantization path, so if the related qconfig
    doesn't meet the requirements, we will not set their inf dtype.
    
intel_extension_for_pytorch/quantization/_recipe.py