6#include "../component_descriptor.hpp"
7#include "../datatypes/tensor_data.hpp"
8#include "../result.hpp"
35 : data(
rerun::datatypes::
TensorData(std::move(shape), std::move(buffer))) {}
42 template <
typename TElement>
54 data = std::move(data_);
70 struct Loggable<components::TensorData> {
71 static constexpr ComponentDescriptor Descriptor =
"rerun.components.TensorData";
74 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
75 return Loggable<rerun::datatypes::TensorData>::arrow_datatype();
79 static Result<std::shared_ptr<arrow::Array>> to_arrow(
80 const components::TensorData* instances,
size_t num_instances
82 if (num_instances == 0) {
83 return Loggable<rerun::datatypes::TensorData>::to_arrow(
nullptr, 0);
84 }
else if (instances ==
nullptr) {
86 ErrorCode::UnexpectedNullArgument,
87 "Passed array instances is null when num_elements> 0."
90 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:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
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(Collection< datatypes::TensorDimension > shape, const TElement *data_)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:43
TensorData(rerun::Collection< rerun::datatypes::TensorDimension > shape, rerun::datatypes::TensorBuffer buffer)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:31
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:99
Datatype: An N-dimensional array of numbers.
Definition tensor_data.hpp:30