code: def ldexp(
      x1: Union[tf.Tensor, tf.Variable],
      x2: Union[tf.Tensor, tf.Variable, int],
      /,
      *,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      out_dtype = x1.dtype
      x1, x2 = ivy.promote_types_of_inputs(x1, x2)
      if tf.math.reduce_any(tf.math.less(x2, 0)):
          pos_exp = tf.cast(tf.math.greater_equal(x2, 0), x2.dtype) * x2
          neg_exp = tf.cast(tf.math.less(x2, 0), x2.dtype) * x2
          ret = tf.cast(x1, pos_exp.dtype) * tf.math.pow(2, pos_exp)
          ret = tf.cast(ret, neg_exp.dtype) / tf.math.pow(2, -neg_exp)
      else:
          x2 = tf.cast(x2, x1.dtype)
          ret = x1 * tf.math.pow(2, x2)
      return tf.cast(ret, out_dtype)
  
imports: import operator
  from typing import Union, Optional, Tuple, List, Sequence
  from numbers import Number
  import tensorflow
  from tensorflow.python.ops.numpy_ops import np_math_ops
  import ivy
  from ivy import promote_types_of_inputs
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ..None import backend_version
label_desc: Use image node_id 23 for calling a global function with example usage: ldexp() and returns: tf