def _validate_conversion_arguments(
    model,
    exact_source,
    exact_target,
    inputs,
    outputs,
    classifier_config,
    compute_precision,
    convert_to,
    minimum_deployment_target,
) -> None:
    """
    Validate and process model, inputs, classifier_config based on
    `exact_source` (which cannot be `auto`) and `exact_target`.
    """

    def raise_if_duplicated(input_list):
        # Detect duplicated inputs
        input_names = [t.name for t in input_list if t.name is not None]
        dups = [
            item
            for item, count in collections.Counter(input_names).items()
            if count > 1
        ]
        if len(dups) > 0:
            raise ValueError("Duplicated inputs: {}".format(dups))

    def _flatten_list(_inputs):
        ret = []
        for _input in _inputs:
            if isinstance(_input, (list, tuple)):
                ret.extend(_flatten_list(_input))
            elif isinstance(_input, InputType):
                ret.append(_input)
            else:
                raise ValueError(
                    "Unknown type {} for flattening into InputType.".format(
                        type(_input)
                    )
                )
        return ret

    flat_inputs = None
    if inputs is not None:
        if not isinstance(inputs, list):
            raise ValueError("`inputs` must be of type list")

        # get flattened inputs
        flat_inputs = _flatten_list(inputs)
        for flat_input in flat_inputs:
            if not isinstance(flat_input, InputType):
                raise ValueError(
                    "inputs must be a list of type ct.TensorType, ct.ImageType, or ct.StateType"
                )
            if flat_input.dtype == types.fp16:
                if not (
                    minimum_deployment_target is not None
                    and minimum_deployment_target >= AvailableTarget.iOS16
                ):
                    raise TypeError(
                        "float16 dtype for inputs is only supported for deployment "
                        "target >= iOS16/macOS13/watchOS9/tvOS16"
                    )

    if exact_target == "mlprogram":
        err_msg_infinite_bound = (
            "For mlprogram, inputs with infinite upper_bound is not allowed. Please set upper_bound"
            ' to a positive value in "RangeDim()" for the "inputs" param in ct.convert().'
        )
        if inputs is not None:
            for flat_input in _flatten_list(inputs):
                tensor_shapes: List[Optional[Shape]] = (
                    flat_input.shape.shapes
                    if isinstance(flat_input.shape, EnumeratedShapes)
                    else [flat_input.shape]
                )
                for tensor_shape in tensor_shapes:
                    if tensor_shape is not None:
                        for shape in tensor_shape.shape:
                            if isinstance(shape, RangeDim) and shape.upper_bound < 0:
                                raise ValueError(err_msg_infinite_bound)

    if outputs is not None:
        for t in outputs:
            if t.dtype == types.fp16:
                if not (
                    minimum_deployment_target is not None
                    and minimum_deployment_target >= AvailableTarget.iOS16
                ):
                    raise TypeError(
                        "float16 dtype for outputs is only supported for deployment "
                        "target >= iOS16/macOS13/watchOS9/tvOS16"
                    )

    if classifier_config is not None:
        if not isinstance(classifier_config, ClassifierConfig):
            raise ValueError("`classifier_config` must be of type ClassifierConfig")

    if convert_to.lower() == "neuralnetwork" and compute_precision is not None:
        raise ValueError(
            "compute_precision is only supported for mlprogram target and must be "
            "None if target=='neuralnetwork'. Note that target may be implicitly set "
            "depending on the minimum_deployment_target. See "
            "minimum_deployment_target for more details."
        )

    if compute_precision is not None:
        if compute_precision not in [precision.FLOAT32, precision.FLOAT16]:
            if not isinstance(compute_precision, FP16ComputePrecision):
                raise ValueError(
                    "'compute_precision' must be either coremltools.precision.FLOAT32 "
                    "or coremltools.precision.FLOAT16 or of type "
                    "coremltools.transform.FP16ComputePrecision()"
                )

    if exact_source in {"tensorflow", "tensorflow2"}:
        if exact_source == "tensorflow" and not _HAS_TF_1:
            raise ValueError(
                'Converter was called with source="tensorflow", but missing ' "tensorflow package"
            )

        if inputs is not None:
            raise_if_duplicated(inputs)

        if inputs is not None and not all(isinstance(_input, InputType) for _input in inputs):
            raise ValueError("Input should be a list of TensorType or ImageType")

    elif exact_source == "pytorch":
        if _HAS_TORCH_EXPORT_API and isinstance(model, ExportedProgram):
            if model.dialect not in ("ATEN", "EDGE"):
                raise NotImplementedError(
                    f"Conversion for models with only ATEN or EDGE dialect is supported/tested. Provided Dialect: {model.dialect}"
                )

        else:
            if is_torch_model(model):
                if inputs is None:
                    raise ValueError(
                        'Expected argument "inputs" for TorchScript models not provided'
                    )

                raise_if_duplicated(flat_inputs)
                if inputs is not None and not all(
                    [isinstance(_input, InputType) for _input in flat_inputs]
                ):
                    raise ValueError(
                        "Input should be a list/tuple (or nested lists/tuples) of TensorType or ImageType"
                    )
            else:
                raise TypeError(
                    "Model must either be a TorchScript object (or .pt or .pth file) or an ExportedProgram object (if using torch.export based API), received: {}".format(
                        type(model)
                    )
                )

    elif exact_source == "milinternal":
        if not isinstance(model, Program):
            raise ValueError(
                "Converter was asked to convert MIL input, but input is not a MIL " "program!"
            )

    Validate and process model, inputs, classifier_config based on
    `exact_source` (which cannot be `auto`) and `exact_target`.
    
coremltools/converters/_converters_entry.py