code: def test_tensor_array_concat(a1, a2):
      ta1 = TensorArray(a1)
      ta2 = TensorArray(a2)
      ta = TensorArray._concat_same_type([ta1, ta2])
      assert len(ta) == a1.shape[0] + a2.shape[0]
      assert ta.dtype.element_dtype == ta1.dtype.element_dtype
      if a1.shape[1:] == a2.shape[1:]:
          assert ta.dtype.element_shape == a1.shape[1:]
          np.testing.assert_array_equal(
              ta.to_numpy(), np.concatenate([a1, a2])
          )
      else:
          assert ta.dtype.element_shape == (None,) * (len(a1.shape) - 1)
          for arr, expected in zip(
              ta.to_numpy(),
              np.array([e for a in [a1, a2] for e in a], dtype=object),
          ):
              np.testing.assert_array_equal(arr, expected)
  
imports: import itertools
  import numpy
  import pandas
  from packaging.version import parse
  import pyarrow
  import pytest
  from ray.air.util.tensor_extensions.arrow import ArrowTensorArray, ArrowTensorType, ArrowVariableShapedTensorArray, ArrowVariableShapedTensorType
  from ray.air.util.tensor_extensions.pandas import TensorArray, TensorDtype
  from ray.air.util.tensor_extensions.utils import create_ragged_ndarray
  from ray._private.utils import _get_pyarrow_version
label_desc: Use image node_id 23 for calling a global function with example usage: test_tensor_array_concat(a1, a2) without return types