def _get_io_supported_types(opset_version: target, input_types: Tuple["InputType"]) -> Set[type]:
    """Get Core ML I/O supported data types based on opset version."""
    # We need to do a lazy import in order to avoid errors during import
    from coremltools.converters.mil.input_types import ImageType

    supported_types = {types.fp32, types.int32}
    if opset_version is not None and opset_version >= target.iOS16:
        supported_types.add(types.fp16)
    if opset_version is not None and opset_version >= target.iOS17:
        if any(map(lambda t: isinstance(t, ImageType) and t.grayscale_use_uint8,
                   input_types)):
            supported_types.add(types.uint8)
    return supported_types
Get Core ML I/O supported data types based on opset version.
coremltools/converters/mil/backend/mil/passes/adjust_io_to_supported_types.py