class ray.data.extensions.tensor_extension.ArrowTensorType(shape: Tuple[int, ...], dtype: pyarrow.lib.DataType)[source]#

Bases: pyarrow.lib.PyExtensionType

Arrow ExtensionType for an array of fixed-shaped, homogeneous-typed tensors.

This is the Arrow side of TensorDtype.

See Arrow extension type docs: https://arrow.apache.org/docs/python/extending_types.html#defining-extension-types-user-defined-types

PublicAPI (beta): This API is in beta and may change before becoming stable.

property shape#

Shape of contained tensors.

property scalar_type#

Returns the type of the underlying tensor elements.


Convert Arrow extension type to corresponding Pandas dtype.


An instance of pd.api.extensions.ExtensionDtype.