TensorData

An N-dimensional array of numbers.

The number of dimensions and their respective lengths is specified by the shape field. The dimensions are ordered from outermost to innermost. For example, in the common case of a 2D RGB Image, the shape would be [height, width, channel].

These dimensions are combined with an index to look up values from the buffer field, which stores a contiguous array of typed values.

Fields fields

shape

Type: List of uint64

The shape of the tensor, i.e. the length of each dimension.

names

Type: nullable List of utf8

The names of the dimensions of the tensor (optional).

If set, should be the same length as datatypes.TensorData#shape. If it has a different length your names may show up improperly, and some constructors may produce a warning or even an error.

Example: ["height", "width", "channel", "batch"].

buffer

Type: TensorBuffer

The content/data.

Arrow datatype arrow-datatype

Struct {
    shape: List<uint64>
    names: nullable List<utf8>
    buffer: DenseUnion {
        0 = "_null_markers": nullable null
        1 = "U8": List<uint8>
        2 = "U16": List<uint16>
        3 = "U32": List<uint32>
        4 = "U64": List<uint64>
        5 = "I8": List<int8>
        6 = "I16": List<int16>
        7 = "I32": List<int32>
        8 = "I64": List<int64>
        9 = "F16": List<float16>
        10 = "F32": List<float32>
        11 = "F64": List<float64>
    }
}

Used by used-by