code: def promoted_primitive_type(type1, type2):
      """
      Given a pair of tensor or primitive types, find the smallest type that can store an instance
      of their primitive type.
      """
      ptype1 = (
          type1.get_primitive() if types.is_tensor(type1) else type1
      )
      ptype2 = (
          type2.get_primitive() if types.is_tensor(type2) else type2
      )
      return types.promote_types(ptype1, ptype2)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/ops/defs/_utils.py
imports: import math
  import coremltools.converters
  import sympy
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from ._op_reqs import *
label_desc: Use image node_id 2 for calling a global function with example usage: promoted_primitive_type(type1, type2) and returns: types