42 template <TensorElement T>
43 bool write(std::span<const T> values, uint64_t first_element = 0)
47 return write_bytes(std::as_bytes(values), first_element *
sizeof(T));
56 bool write_bytes(std::span<const std::byte> bytes, uint64_t byte_offset = 0);
80 bool reshape(std::vector<uint64_t> shape);
88 bool resize(std::vector<uint64_t> shape);
91 bool set_axes(std::vector<DataDimension> axes);
93 bool set_quantization(std::optional<TensorQuantization> quantization);
Validated, non-owning view of tensor memory and its layout.
Owning host tensor: a TensorSpec and the bytes it describes.
void set_name(std::string name)
Rename the tensor.
bool write(std::span< const T > values, uint64_t first_element=0)
Write typed values into a dense tensor.
TensorInsertion(TensorData &tensor) noexcept
Borrow the tensor to write into.
bool write_bytes(std::span< const std::byte > bytes, uint64_t byte_offset=0)
Write raw bytes into the elements of a dense tensor.
Represents a point or span in N-dimensional space.