code: def promote_input_dtypes(input_vars):
      """
      This utility function promotes all input variables to the same data type.
      It is used to homogenize inputs to an op such as matmul / elementwise_binary,
      and not the inputs to a function itself.
      """
  
      def _is_same_dtype(dtype1, dtype2):
          return builtin_to_string(dtype1) == builtin_to_string(dtype2)
  
      def _promoted_var(var, promoted_dtype):
          if var.val is None:
              x = mb.cast(
                  x=var,
                  dtype=builtin_to_string(promoted_dtype),
                  name=var.name + "_promoted",
              )
          else:
              const_value_after_cast = cast_op_class.get_cast_value(
                  var, builtin_to_string(promoted_dtype)
              )
              x = mb.const(
                  val=const_value_after_cast,
                  name=var.name + "_promoted",
              )
          return x
  
      for i, var in enumerate(input_vars):
          if not isinstance(var, Var):
              input_vars[i] = mb.const(val=var)
  
      promoted_dtype = promote_dtypes([var.dtype for var in input_vars])
  
      for i, var in enumerate(input_vars):
          if not _is_same_dtype(var.dtype, promoted_dtype):
              input_vars[i] = _promoted_var(var, promoted_dtype)
  
      return input_vars
  
imports: import math
  import numbers
  from typing import List, Tuple
  import numpy
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Var, get_new_symbol, types
  from coremltools.converters.mil.mil.ops.defs.iOS15.elementwise_unary import cast
  from coremltools.converters.mil.mil.types import builtin_to_string, promote_dtypes
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
label_desc: Use image node_id 9 for calling a global function with example usage: promote_input_dtypes(input_vars) and returns: input_vars, unknown, x