def set_tensor_info_dtype(tensor_info: QTensorInfo, observer):
    """
    This function is expected to be called on the prepare step which is tensor_info's
    inf_dtype is not same as observe's dtype when user load a changed configure json file.
    """
    quantized_dtype = [torch.quint8, torch.qint8]
    if (
        tensor_info.inf_dtype in quantized_dtype
        and tensor_info.inf_dtype != tensor_info.orig_dtype
        and tensor_info.inf_dtype != observer.dtype
    ):
        tensor_info.inf_dtype = observer.dtype

    This function is expected to be called on the prepare step which is tensor_info's
    inf_dtype is not same as observe's dtype when user load a changed configure json file.
    
intel_extension_for_pytorch/quantization/_quantization_state_utils.py