Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::datatypes::TensorData Struct Reference

Datatype: An N-dimensional array of numbers. More...

#include <rerun/datatypes/tensor_data.hpp>

Public Member Functions

 TensorData (Collection< uint64_t > shape_, datatypes::TensorBuffer buffer_)
 New tensor data from shape and tensor buffer.
 
template<typename TElement >
 TensorData (Collection< uint64_t > shape_, const TElement *data)
 New tensor data from dimensions and pointer to tensor data.
 

Public Attributes

rerun::Collection< uint64_t > shape
 The shape of the tensor, i.e. the length of each dimension.
 
std::optional< rerun::Collection< std::string > > names
 The names of the dimensions of the tensor (optional).
 
rerun::datatypes::TensorBuffer buffer
 The content/data.
 

Detailed Description

Datatype: 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.

Constructor & Destructor Documentation

◆ TensorData() [1/2]

rerun::datatypes::TensorData::TensorData ( Collection< uint64_t >  shape_,
datatypes::TensorBuffer  buffer_ 
)
inline

New tensor data from shape and tensor buffer.

Parameters
shape_Shape of the tensor.
buffer_The tensor buffer containing the tensor's data.

◆ TensorData() [2/2]

template<typename TElement >
rerun::datatypes::TensorData::TensorData ( Collection< uint64_t >  shape_,
const TElement *  data 
)
inlineexplicit

New tensor data from dimensions and pointer to tensor data.

Type must be one of the types supported by rerun::datatypes::TensorData.

Parameters
shape_Shape of the tensor. Determines the number of elements expected to be in data.
dataTarget of the pointer must outlive the archetype.

Member Data Documentation

◆ names

std::optional<rerun::Collection<std::string> > rerun::datatypes::TensorData::names

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"].


The documentation for this struct was generated from the following file: