def ct_convert(
    program,
    source="auto",
    inputs=None,
    outputs=None,
    classifier_config=None,
    minimum_deployment_target=None,
    convert_to=None,
    compute_precision=None,
    skip_model_load=False,
    converter=ct.convert,
    **kwargs,
):

    """
    Overloaded ct.convert function with the only difference being in the argument `convert_to`
    which in this overloaded call accepts a tuple of (target, dtype).
    Ex: ("neuralnetwork", "fp32"), ("mlprogram", "fp16")
    """

    if isinstance(converter, partial):
        raise ValueError("Partial function is not supported for function-parameter 'converter' since its keywords arguments could get overridden.")

    target, dtype = convert_to

    if dtype not in ["fp32", "fp16"]:
        raise ValueError("Unsupported dtype config")

    compute_precision = ct.precision.FLOAT16 if dtype == "fp16" else ct.precision.FLOAT32
    if target == "neuralnetwork":
        compute_precision = None

    PYTEST_CURRENT_TEST = os.environ.get("PYTEST_CURRENT_TEST").split("(call)")[0].strip()
    is_current_test_to_be_debugged = PYTEST_CURRENT_TEST in debug_save_mlmodels
    if is_current_test_to_be_debugged:
        # If current test is to be debugged, then it is probably buggy in Core ML framework,
        # so we skip its load to dodge potential bug which might kill python process
        skip_model_load = True

    mlmodel = converter(
        program,
        source=source,
        inputs=inputs,
        outputs=outputs,
        classifier_config=classifier_config,
        minimum_deployment_target=minimum_deployment_target,
        convert_to=target,
        compute_precision=compute_precision,
        skip_model_load=skip_model_load,
        **kwargs,
    )

    if is_current_test_to_be_debugged:
        _serialize_current_pytest_mlmodel(mlmodel)
        pytest.xfail("This test is to be debugged")

    return mlmodel

    Overloaded ct.convert function with the only difference being in the argument `convert_to`
    which in this overloaded call accepts a tuple of (target, dtype).
    Ex: ("neuralnetwork", "fp32"), ("mlprogram", "fp16")
    
coremltools/converters/mil/testing_utils.py