---
title: "TensorData"
---
<!-- DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/docs/website.rs -->

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
#### `shape`
Type: non-null List of `UInt64`

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

#### `names`
Type: List of `Utf8`

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

If set, should be the same length as [`datatypes.TensorData#shape`](https://rerun.io/docs/reference/types/datatypes/tensor_data).
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: non-null [`TensorBuffer`](../datatypes/tensor_buffer.md)

The content/data.


## Arrow datatype
```
Struct(
    "shape": non-null List(non-null UInt64)
    "names": List(non-null Utf8)
    "buffer": non-null Union(Dense,
        0: ("_null_markers": Null)
        1: ("U8": non-null List(non-null UInt8))
        2: ("U16": non-null List(non-null UInt16))
        3: ("U32": non-null List(non-null UInt32))
        4: ("U64": non-null List(non-null UInt64))
        5: ("I8": non-null List(non-null Int8))
        6: ("I16": non-null List(non-null Int16))
        7: ("I32": non-null List(non-null Int32))
        8: ("I64": non-null List(non-null Int64))
        9: ("F16": non-null List(non-null Float16))
        10: ("F32": non-null List(non-null Float32))
        11: ("F64": non-null List(non-null Float64))
    )
)
```

## API reference links
 * 🌊 [C++ API docs for `TensorData`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1TensorData.html)
 * 🐍 [Python API docs for `TensorData`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.TensorData)
 * 🦀 [Rust API docs for `TensorData`](https://docs.rs/rerun/latest/rerun/datatypes/struct.TensorData.html)


## Used by

* [`TensorData`](../components/tensor_data.md)
