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

◆ bytes()

std::span< const std::byte > MayaFlux::Kakshya::TensorAccess::bytes ( ) const
nodiscardnoexcept

Bytes of the elements when they are dense in C order.

Returns
The packed bytes, or an empty span for a strided layout.

Definition at line 44 of file TensorAccess.cpp.

45{
46 const auto* first = element_data();
47 if (!first || !m_spec.is_contiguous())
48 return {};
49 const auto size = m_spec.dtype.storage_bytes(element_count());
50 return size ? std::span<const std::byte>(first, *size) : std::span<const std::byte> {};
51}
uint64_t element_count() const noexcept
Number of elements.
const std::byte * element_data() const noexcept
Pointer to element zero, or nullptr for an empty tensor.

References element_count(), element_data(), and m_spec.

Referenced by as(), and gpu_view().

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