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

◆ view() [2/2]

std::optional< TensorAccess > MayaFlux::Kakshya::TensorContainer::view ( const Region & region) const
nodiscard

Borrow the box a Region selects, without copying.

Parameters
regionInclusive bounds; trailing axes not named span fully.
Returns
Strided view, or std::nullopt when the region is empty, has more axes than the tensor, leaves the shape, or cannot be addressed.

Definition at line 48 of file TensorContainer.cpp.

49{
50 const auto window = m_data.spec().window(region);
51 if (!window)
52 return std::nullopt;
53
54 return as_tensor_access(m_data.storage(), *window, false);
55}
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(), and m_data.

Here is the call graph for this function: