6#include "../datatypes/tensor_data.hpp"
7#include "../result.hpp"
34 : data(
rerun::datatypes::
TensorData(std::move(shape), std::move(buffer))) {}
41 template <
typename TElement>
53 data = std::move(data_);
69 struct Loggable<components::TensorData> {
70 static constexpr const char Name[] =
"rerun.components.TensorData";
73 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
74 return Loggable<rerun::datatypes::TensorData>::arrow_datatype();
78 static Result<std::shared_ptr<arrow::Array>> to_arrow(
79 const components::TensorData* instances,
size_t num_instances
81 if (num_instances == 0) {
82 return Loggable<rerun::datatypes::TensorData>::to_arrow(
nullptr, 0);
83 }
else if (instances ==
nullptr) {
85 ErrorCode::UnexpectedNullArgument,
86 "Passed array instances is null when num_elements> 0."
89 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:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: An N-dimensional array of numbers.
Definition tensor_data.hpp:22
TensorData(Collection< datatypes::TensorDimension > shape, const TElement *data_)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:42
TensorData(rerun::Collection< rerun::datatypes::TensorDimension > shape, rerun::datatypes::TensorBuffer buffer)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:30
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:98
Datatype: An N-dimensional array of numbers.
Definition tensor_data.hpp:29