6#include "../datatypes/tensor_data.hpp"
7#include "../result.hpp"
31 : data(
rerun::datatypes::
TensorData(std::move(shape), std::move(buffer))) {}
38 template <
typename TElement>
50 data = std::move(data_);
66 struct Loggable<components::TensorData> {
67 static constexpr std::string_view ComponentType =
"rerun.components.TensorData";
70 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
71 return Loggable<rerun::datatypes::TensorData>::arrow_datatype();
75 static Result<std::shared_ptr<arrow::Array>> to_arrow(
76 const components::TensorData* instances,
size_t num_instances
78 if (num_instances == 0) {
79 return Loggable<rerun::datatypes::TensorData>::to_arrow(
nullptr, 0);
80 }
else if (instances ==
nullptr) {
82 ErrorCode::UnexpectedNullArgument,
83 "Passed array instances is null when num_elements> 0."
86 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:99
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:22
TensorData(rerun::Collection< uint64_t > shape, rerun::datatypes::TensorBuffer buffer)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:30
TensorData(Collection< uint64_t > shape, const TElement *data_)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:39
Datatype: The underlying storage for archetypes::Tensor.
Definition tensor_buffer.hpp:98
Datatype: An N-dimensional array of numbers.
Definition tensor_data.hpp:30