code: def test_tensor_array_validation():
      # Test unknown input type raises TypeError.
      with pytest.raises(TypeError):
          TensorArray(object())
  
      # Test non-primitive element raises TypeError.
      with pytest.raises(TypeError):
          TensorArray(np.array([object(), object()]))
  
      with pytest.raises(TypeError):
          TensorArray([object(), object()])
  
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 2 for calling a global function with example usage: test_tensor_array_validation() without return types