code: def promote_types_torch(
      type1: Union[ivy.Dtype, ivy.NativeDtype],
      type2: Union[ivy.Dtype, ivy.NativeDtype],
      /,
  ) -> ivy.Dtype:
      """Promote the datatypes type1 and type2, returning the data type they
      promote to.
  
      Parameters
      ----------
      type1
          the first of the two types to promote
      type2
          the second of the two types to promote
  
      Returns
      -------
      ret
          The type that both input types promote to
      """
      try:
          ret = torch_frontend.torch_promotion_table[
              (ivy.as_ivy_dtype(type1), ivy.as_ivy_dtype(type2))
          ]
      except KeyError as e:
          raise ivy.utils.exceptions.IvyException(
              "these dtypes are not type promotable"
          ) from e
      return ret
  
imports: import sys
  from numbers import Number
  from typing import Union, Tuple, Iterable
  import ivy
  from ivy.utils.exceptions import handle_exceptions
  from ivy.functional.frontends import set_frontend_to_specific_version
  from .None import nn
  from .nn.functional import softmax, relu, lstm
  from .None import tensor
  from .tensor import *
  from .None import blas_and_lapack_ops
  from .blas_and_lapack_ops import *
  from .None import comparison_ops
  from .comparison_ops import *
  from .None import creation_ops
  from .creation_ops import *
  from .None import dtype
  from .dtype import *
  from .None import indexing_slicing_joining_mutating_ops
  from .indexing_slicing_joining_mutating_ops import *
  from .None import locally_disabling_gradient_computation
  from .locally_disabling_gradient_computation import *
  from .None import miscellaneous_ops
  from .miscellaneous_ops import *
  from .None import pointwise_ops
  from .pointwise_ops import *
  from .None import random_sampling
  from .random_sampling import *
  from .None import reduction_ops
  from .reduction_ops import *
  from .None import spectral_ops
  from .spectral_ops import *
  from .None import tensor_functions
  from .tensor_functions import *
  from .None import utilities
  from .utilities import *
  from .None import linalg
  from .None import func
  from .func import *
label_desc: Use image node_id 1 for calling a global function with example usage: promote_types_torch() and returns: ret