def infer_complex_dtype(real_dtype, imag_dtype):
    """Infers the complex dtype from real and imaginary part's dtypes."""
    promoted_dtype = promote_types(real_dtype, imag_dtype)
    if promoted_dtype == types_fp32:
        return types_complex64
    elif promoted_dtype == types_fp64:
        return types_complex128
    else:
        raise ValueError(
            f"Unsupported real/imag dtype ({real_dtype}/{imag_dtype}) to construct a "
            f"complex dtype."
        )
Infers the complex dtype from real and imaginary part's dtypes.
coremltools/converters/mil/mil/types/type_mapping.py