6#include "../collection.hpp"
7#include "../result.hpp"
8#include "tensor_buffer.hpp"
9#include "tensor_dimension.hpp"
44 : shape(std::move(shape_)), buffer(std::move(buffer_)) {}
51 template <
typename TElement>
53 : shape(std::move(shape_)) {
54 size_t num_elements = shape.
empty() ? 0 : 1;
55 for (
const auto& dim : shape) {
56 num_elements *= dim.size;
72 struct Loggable<datatypes::TensorData> {
73 static constexpr const char Name[] =
"rerun.datatypes.TensorData";
76 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
80 arrow::StructBuilder* builder,
const datatypes::TensorData* elements,
85 static Result<std::shared_ptr<arrow::Array>> to_arrow(
86 const datatypes::TensorData* instances,
size_t num_instances
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:47
bool empty() const
Returns true if the collection is empty.
Definition collection.hpp:265
static Collection< TElement > borrow(const T *data, size_t num_instances)
Borrows binary compatible data into the collection.
Definition collection.hpp:149
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Datatype: The underlying storage for a Tensor.
Definition tensor_buffer.hpp:93
Datatype: A multi-dimensional Tensor of data.
Definition tensor_data.hpp:29
TensorData(Collection< rerun::datatypes::TensorDimension > shape_, datatypes::TensorBuffer buffer_)
New tensor data from shape and tensor buffer.
Definition tensor_data.hpp:41
TensorData(Collection< datatypes::TensorDimension > shape_, const TElement *data)
New tensor data from dimensions and pointer to tensor data.
Definition tensor_data.hpp:52