def prepare(
    model,
    configure,
    example_inputs=None,
    inplace=False,
    bn_folding=True,
    example_kwarg_inputs=None,
):
    r"""
    Prepare an FP32 torch.nn.Module model to do calibration or to convert to quantized model.

    Args:
        model (torch.nn.Module): The FP32 model to be prepared.
        configure (torch.quantization.qconfig.QConfig): The observer settings about activation and weight.
        example_inputs (tuple or torch.Tensor): A tuple of example inputs that
            will be passed to the function while running to init quantization state. Only one of this
            argument or ``example_kwarg_inputs`` should be specified.
        inplace: (bool): It will change the given model in-place if True. The default value is ``False``.
            Note that if ``bn_folding`` is ``True``, the returned model is a different object from the
            original model even if ``inplace=True``. So, with the following code
            >>> prepared_model = prepare(original_model, ..., inplace=True)
            please use ``prepared_model`` for later operations to avoid unexpected behaviors.
        bn_folding: (bool): whether to perform ``conv_bn`` and ``linear_bn`` folding.
            The default value is ``True``.
        example_kwarg_inputs (dict):  A dict of example inputs that will be passed to the function while
            running to init quantization state. Only one of this argument or ``example_inputs`` should be
            specified.

    Returns:
        torch.nn.Module
    """
    assert isinstance(
        model, torch.nn.Module
    ), "Only support nn.Module prepare for quantization path"
    assert isinstance(configure, QConfigMapping) or isinstance(
        configure, QConfig
    ), f"IPEX quantization: prepare configure should be an instance of QConfigMapping or QConfig, but got {type(configure)}"
    if isinstance(configure, QConfig):
        logger.warning(
            "\nIPEX quantization: QConfig are deprecated. Please use QConfigMapping instead.\nUsage:"
            + "\n    qconfig_mapping = ipex.quantization.default_static_qconfig_mapping # for static quantization"
            + "\n    qconfig_mapping = ipex.quantization.default_dynamic_qconfig_mapping # for dynamic quantization"
            + "\n    prepared_model = ipex.quantization.prepare(model_fp32, qconfig_mapping, ...)",
            _type=WarningType.AmbiguousArgument,
        )
    if isinstance(configure, QConfigMapping):
        configure = configure.global_qconfig
    if not isinstance(configure.activation(), PlaceholderObserver):
        assert example_inputs is not None or example_kwarg_inputs is not None, (
            "IPEX quantization.prepare: example_inputs and example_kwarg_inputs cannot be none at same time "
            "for static quantization."
        )
    # auto model channels_last memory format conversion
    from ..frontend import (
        auto_channels_last,
        _convert_convNd_deconvNd_weight_memory_format,
    )

    if auto_channels_last:
        _convert_convNd_deconvNd_weight_memory_format(model)
    if inplace:
        prepare_model = model
    else:
        try:
            prepare_model = copy.deepcopy(model)
        except BaseException:
            AssertionError(
                False
            ), "The model's copy is failed, please try set inplace to True to do the prepare"
    if bn_folding:
        try:
            prepare_model = optimization.fuse(prepare_model, inplace=inplace)
            prepare_model = linear_bn_fuse(prepare_model, inplace=inplace)
        except BaseException:
            logger.warning(
                "BatchNorm folding failed during the prepare process.",
                _type=WarningType.NotSupported,
            )

    # replace dropout with identity to enable more fusion pattern.
    nn.utils._model_convert.replace_dropout_with_identity(prepare_model)
    assert (
        example_inputs is None or example_kwarg_inputs is None
    ), "IPEX quantization.prepare: example_inputs and example_kwarg_inputs cannot be set at same time."
    # Special case for common case of passing a single Tensor
    if isinstance(example_inputs, (torch.Tensor, dict)):
        example_inputs = (example_inputs,)
    elif not isinstance(example_inputs, tuple) and example_inputs is not None:
        example_inputs = tuple(example_inputs)
    if example_kwarg_inputs is not None:
        assert isinstance(
            example_kwarg_inputs, Dict
        ), "IPEX quantization.prepare: example_kwarg_inputs must be type of Dict."
    return auto_prepare(prepare_model, configure, example_inputs, example_kwarg_inputs)

    Prepare an FP32 torch.nn.Module model to do calibration or to convert to quantized model.

    Args:
        model (torch.nn.Module): The FP32 model to be prepared.
        configure (torch.quantization.qconfig.QConfig): The observer settings about activation and weight.
        example_inputs (tuple or torch.Tensor): A tuple of example inputs that
            will be passed to the function while running to init quantization state. Only one of this
            argument or ``example_kwarg_inputs`` should be specified.
        inplace: (bool): It will change the given model in-place if True. The default value is ``False``.
            Note that if ``bn_folding`` is ``True``, the returned model is a different object from the
            original model even if ``inplace=True``. So, with the following code
            >>> prepared_model = prepare(original_model, ..., inplace=True)
            please use ``prepared_model`` for later operations to avoid unexpected behaviors.
        bn_folding: (bool): whether to perform ``conv_bn`` and ``linear_bn`` folding.
            The default value is ``True``.
        example_kwarg_inputs (dict):  A dict of example inputs that will be passed to the function while
            running to init quantization state. Only one of this argument or ``example_inputs`` should be
            specified.

    Returns:
        torch.nn.Module
    
intel_extension_for_pytorch/quantization/_quantize.py