6#include "../component_descriptor.hpp"
7#include "../datatypes/tensor_data.hpp"
8#include "../result.hpp"
32 : data(
rerun::datatypes::
TensorData(std::move(shape), std::move(buffer))) {}
39 template <
typename TElement>
51 data = std::move(data_);
67 struct Loggable<components::TensorData> {
68 static constexpr ComponentDescriptor Descriptor =
"rerun.components.TensorData";
71 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
72 return Loggable<rerun::datatypes::TensorData>::arrow_datatype();
76 static Result<std::shared_ptr<arrow::Array>> to_arrow(
77 const components::TensorData* instances,
size_t num_instances
79 if (num_instances == 0) {
80 return Loggable<rerun::datatypes::TensorData>::to_arrow(
nullptr, 0);
81 }
else if (instances ==
nullptr) {
83 ErrorCode::UnexpectedNullArgument,
84 "Passed array instances is null when num_elements> 0."
87 return Loggable<rerun::datatypes::TensorData>::to_arrow(
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:96
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: An N-dimensional array of numbers.
Definition tensor_data.hpp:23
TensorData(rerun::Collection< uint64_t > shape, rerun::datatypes::TensorBuffer buffer)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:31
TensorData(Collection< uint64_t > shape, const TElement *data_)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:40
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:99
Datatype: An N-dimensional array of numbers.
Definition tensor_data.hpp:31