code: def concat(
      xs: Union[Tuple[paddle.Tensor, ...], List[paddle.Tensor]],
      /,
      *,
      axis: Optional[int] = 0,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      dtypes_list = list(set(map(lambda x: x.dtype, xs)))
      dtype = dtypes_list.pop()
      if len(dtypes_list) > 0:
          for d in dtypes_list:
              dtype = ivy.promote_types(dtype, d)
      xs = list(
          map(
              lambda x: x.cast(
                  "int32" if dtype == paddle.int16 else dtype
              ),
              xs,
          )
      )
      if all(0 in x.shape for x in xs):
          shapes = [x.shape for x in xs]
          if any(len(s) != len(shapes[0]) for s in shapes):
              raise ivy.exceptions.IvyValueError(
                  "all the input arrays must have the same number of dimensions"
              )
          axis = axis + len(xs[0].shape) if axis < 0 else axis
          sizes = [
              [v for i, v in enumerate(s) if i != axis] for s in shapes
          ]
          if any(s != sizes[0] for s in sizes):
              raise ivy.exceptions.IvyValueError(
                  "the input arrays must have the same size along the specified axis"
              )
          ret = paddle.empty(
              [
                  *shapes[0][:axis],
                  sum(s[axis] for s in shapes),
                  *shapes[0][axis + 1 :],
              ],
              dtype=dtype,
          )
      else:
          ret = paddle.concat(xs, axis=axis)
      if dtype == paddle.int16:
          ret = ret.cast("int16")
      return ret
  
imports: from numbers import Number
  from typing import Union, Optional, Tuple, List, Sequence, Iterable
  import math
  import paddle
  import ivy
  import ivy.functional.backends.paddle
  from ivy.func_wrapper import with_unsupported_device_and_dtypes, with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
  from ...ivy.manipulation import _calculate_out_shape
label_desc: Use image node_id 1 for calling a global function with example usage: concat() and returns: ret