code: def concat(
      xs: Union[Tuple[tf.Tensor, ...], List[tf.Tensor]],
      /,
      *,
      axis: int = 0,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      if axis is not None:
          try:
              return tf.concat(xs, axis)
          except tf.errors.InvalidArgumentError as error:
              if "(zero-based) was expected to be" in error.message:
                  highest_dtype = xs[0].dtype
                  for i in xs:
                      highest_dtype = ivy.promote_types(
                          highest_dtype, i.dtype
                      )
                  highest_dtype = ivy.as_native_dtype(highest_dtype)
                  return tf.concat(
                      [
                          tf.cast(x, highest_dtype)
                          if x.dtype != highest_dtype
                          else x
                          for x in xs
                      ],
                      axis,
                  )
              else:
                  raise
      return concat([tf.reshape(x, -1) for x in xs], axis=0)
  
imports: import math
  from numbers import Number
  from typing import Union, Tuple, Optional, List, Sequence
  import numpy
  import tensorflow
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.manipulation import _calculate_out_shape
  from .None import backend_version
label_desc: Use image node_id 2 for calling a global function with example usage: concat() and returns: concat, tf, tf