code: def promote_types_of_torch_inputs(
      x1: Union[ivy.Array, Number, Iterable[Number]],
      x2: Union[ivy.Array, Number, Iterable[Number]],
      /,
  ) -> Tuple[ivy.Array, ivy.Array]:
      """Promote the dtype of the given native array inputs to a common dtype
      based on type promotion rules.
  
      While passing float or integer values or any other non-array input
      to this function, it should be noted that the return will be an
      array-like object. Therefore, outputs from this function should be
      used as inputs only for those functions that expect an array-like or
      tensor-like objects, otherwise it might give unexpected results.
      """
      if ivy.isscalar(x1) and ivy.is_int_dtype(x1):
          x1 = ivy.asarray(x1, dtype="int64")
      elif ivy.isscalar(x1):
          x1 = ivy.asarray(x1)
      if ivy.isscalar(x2) and ivy.is_int_dtype(x2):
          x2 = ivy.asarray(x2, dtype="int64")
      elif ivy.isscalar(x2):
          x2 = ivy.asarray(x2)
      type1 = ivy.default_dtype(item=x1).strip("u123456789")
      type2 = ivy.default_dtype(item=x2).strip("u123456789")
      if x1.shape != () and x2.shape == () and type1 == type2:
          x2 = ivy.asarray(
              x2,
              dtype=x1.dtype,
              device=ivy.default_device(item=x1, as_native=False),
          )
      elif x1.shape == () and x2.shape != () and type1 == type2:
          x1 = ivy.asarray(
              x1,
              dtype=x2.dtype,
              device=ivy.default_device(item=x2, as_native=False),
          )
      elif x1.dtype != x2.dtype:
          promoted = promote_types_torch(x1.dtype, x2.dtype)
          if x1.dtype != promoted:
              x1 = x1.astype(promoted)
          if x2.dtype != promoted:
              x2 = x2.astype(promoted)
      return x1, x2
  
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 2 for calling a global function with example usage: promote_types_of_torch_inputs() and returns: x1,  x2