|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Mutable adapter for writing into a TensorData. More...
#include <TensorInsertion.hpp>
Public Member Functions | |
| bool | assign (const TensorAccess &view) |
| Overwrite the tensor with a copy of a view of the same dtype and shape. | |
| bool | assign_window (const Region ®ion, const TensorAccess &view) |
| Overwrite the box a Region selects with a view of the box's shape. | |
| bool | reshape (std::vector< uint64_t > shape) |
| Change the shape without moving data. | |
| bool | resize (std::vector< uint64_t > shape) |
| Replace the shape and reallocate. | |
| bool | set_axes (std::vector< DataDimension > axes) |
| Attach per-axis roles and names; the count must equal the rank. | |
| void | set_name (std::string name) |
| Rename the tensor. | |
| bool | set_quantization (std::optional< TensorQuantization > quantization) |
| Attach or clear quantization; it must be consistent with the shape. | |
| TensorInsertion (TensorData &tensor) noexcept | |
| Borrow the tensor to write into. | |
| template<TensorElement T> | |
| bool | write (std::span< const T > values, uint64_t first_element=0) |
| Write typed values into a dense tensor. | |
| bool | write_bytes (std::span< const std::byte > bytes, uint64_t byte_offset=0) |
| Write raw bytes into the elements of a dense tensor. | |
Private Attributes | |
| TensorData * | m_tensor |
Mutable adapter for writing into a TensorData.
Writes typed values or raw bytes, copies a whole view into the tensor, reshapes, resizes, and attaches axes or quantization. Every call validates against the tensor's spec and returns false, leaving the tensor unchanged, on a mismatch.
Usage:
Definition at line 27 of file TensorInsertion.hpp.