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

◆ access()

std::optional< TensorAccess > MayaFlux::Kakshya::TensorData::access ( ) const
nodiscard

Borrow the tensor, or std::nullopt when it holds nothing valid.

Definition at line 150 of file Tensor.cpp.

151{
152 if (!is_valid())
153 return std::nullopt;
154 return as_tensor_access(storage(), m_spec, false);
155}
bool is_valid() const noexcept
Whether the tensor holds a consistent spec and its storage.
Definition Tensor.hpp:107
std::span< const std::byte > storage() const noexcept
The whole stored block.
Definition Tensor.hpp:111
std::optional< TensorAccess > as_tensor_access(std::span< const std::byte > storage, const TensorSpec &spec, bool read_only)
Validate and borrow tensor memory.

References MayaFlux::Kakshya::as_tensor_access(), is_valid(), m_spec, and storage().

Referenced by MayaFlux::IO::Detail::dense_bytes(), and to_vector().

Here is the call graph for this function:
Here is the caller graph for this function: