MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write()

template<TensorElement T>
bool MayaFlux::Kakshya::TensorInsertion::write ( std::span< const T > values,
uint64_t first_element = 0 )
inline

Write typed values into a dense tensor.

Template Parameters
TElement type equal to the tensor dtype.
Parameters
valuesElements to write.
first_elementIndex of the first element to overwrite.
Returns
False for a dtype mismatch, a strided layout or a range past the end.

Definition at line 43 of file TensorInsertion.hpp.

44 {
45 if (!m_tensor->m_spec.dtype.is<T>())
46 return false;
47 return write_bytes(std::as_bytes(values), first_element * sizeof(T));
48 }
bool write_bytes(std::span< const std::byte > bytes, uint64_t byte_offset=0)
Write raw bytes into the elements of a dense tensor.

References m_tensor, and write_bytes().

Here is the call graph for this function: