Skip to main content

Module tensor

Module tensor 

Source
Expand description

Conversion between nd columns and the Arrow canonical tensor types arrow.fixed_shape_tensor and arrow.variable_shape_tensor.

The canonical types keep the dimension names in the field metadata, so all rows of a column must share their names and rank. They have no attributes, and their elements cannot be null: fill nulls before a conversion.

The canonical dim_names and shape describe the physical row-major layout, which is the nd layout. A permutation is only a view hint, so a conversion from a tensor ignores it.

This module writes and reads the metadata JSON itself, by the Arrow specification. It reads both permutation and permutations keys.

Constants§

FIXED_SHAPE_TENSOR
Extension name of the Arrow canonical fixed shape tensor.
VARIABLE_SHAPE_TENSOR
Extension name of the Arrow canonical variable shape tensor.

Functions§

column_from_field
Read a column that is an nd column or a canonical tensor column, by the extension name on field.
to_fixed_shape_tensor
Convert to an arrow.fixed_shape_tensor field named name and its storage. All non-null rows need the same dimensions.
to_variable_shape_tensor
Convert to an arrow.variable_shape_tensor field named name and its storage. The values are not copied.