6#include "../collection.hpp"
7#include "../component_descriptor.hpp"
8#include "../result.hpp"
9#include "tensor_buffer.hpp"
42 std::optional<rerun::Collection<std::string>>
names;
53 :
shape(std::move(shape_)),
buffer(std::move(buffer_)) {}
60 template <
typename TElement>
62 :
shape(std::move(shape_)) {
64 for (
const auto& dim :
shape) {
83 struct Loggable<datatypes::TensorData> {
84 static constexpr ComponentDescriptor Descriptor =
"rerun.datatypes.TensorData";
87 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
90 static Result<std::shared_ptr<arrow::Array>> to_arrow(
91 const datatypes::TensorData* instances,
size_t num_instances
96 arrow::StructBuilder* builder,
const datatypes::TensorData* elements,
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
static Collection< TElement > borrow(const T *data, size_t num_instances=1)
Borrows binary compatible data into the collection from a typed pointer.
Definition collection.hpp:154
bool empty() const
Returns true if the collection is empty.
Definition collection.hpp:306
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:99
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:82
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:99
Datatype: An N-dimensional array of numbers.
Definition tensor_data.hpp:31
rerun::datatypes::TensorBuffer buffer
The content/data.
Definition tensor_data.hpp:45
rerun::Collection< uint64_t > shape
The shape of the tensor, i.e. the length of each dimension.
Definition tensor_data.hpp:33
std::optional< rerun::Collection< std::string > > names
The names of the dimensions of the tensor (optional).
Definition tensor_data.hpp:42
TensorData(Collection< uint64_t > shape_, const TElement *data)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:61
TensorData(Collection< uint64_t > shape_, datatypes::TensorBuffer buffer_)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:52