class_docstr: Arrow ExtensionType for an array of heterogeneous-shaped, homogeneous-typed
  tensors.
  
  This is the Arrow side of TensorDtype for tensor elements with different shapes.
  Note that this extension only supports non-ragged tensor elements; i.e., when
  considering each tensor element in isolation, they must have a well-defined,
  non-ragged shape.
  
  See Arrow extension type docs:
  https://arrow.apache.org/docs/python/extending_types.html#defining-extension-types-user-defined-types
class_docstr_tok: ["Arrow","ExtensionType","for","an","array","of","heterogeneous-shaped",",","homogeneous-typed","tensors",".","This","is","the","Arrow","side","of","TensorDtype","for","tensor","elements","with","different","shapes",".","Note","that","this","extension","only","supports","non-ragged","tensor","elements",";","i.e.",",","when","considering","each","tensor","element","in","isolation",",","they","must","have","a","well-defined",",","non-ragged","shape",".","See","Arrow","extension","type","docs",":","https",":","\/\/arrow.apache.org\/docs\/python\/extending_types.html","#","defining-extension-types-user-defined-types"]
docstr: Construct the Arrow extension type for array of heterogeneous-shaped tensors.
  
  Args:
      dtype: pyarrow dtype of tensor elements.
      ndim: The number of dimensions in the tensor elements.
docstr_tok: ["Construct","the","Arrow","extension","type","for","array","of","heterogeneous-shaped","tensors",".","Args",":","dtype",":","pyarrow","dtype","of","tensor","elements",".","ndim",":","The","number","of","dimensions","in","the","tensor","elements","."]
code: def __init__(self, dtype: pa.DataType, ndim: int):
      """
      Construct the Arrow extension type for array of heterogeneous-shaped tensors.
  
      Args:
          dtype: pyarrow dtype of tensor elements.
          ndim: The number of dimensions in the tensor elements.
      """
      self._ndim = ndim
      super().__init__(
          pa.struct(
              [
                  ("data", pa.list_(dtype)),
                  ("shape", pa.list_(pa.int64())),
              ]
          ),
          "ray.data.arrow_variable_shaped_tensor",
      )
  
imports: import itertools
  import json
  import sys
  from typing import Iterable, Optional, Tuple, List, Sequence, Union
  from packaging.version import parse
  import numpy
  import pyarrow
  from ray.air.util.tensor_extensions.utils import _is_ndarray_variable_shaped_tensor, create_ragged_ndarray
  from ray._private.utils import _get_pyarrow_version
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 1 to create a new ArrowVariableShapedTensorType object from inherited base classes: pa with example: obj = ArrowVariableShapedTensorType(dtype, ndim)