Class MemoryStack¶
Defined in File stack_checker.hpp
Class Documentation¶
-
class MemoryStack¶
Simulates the memory stack of a backend that only supports stack-like allocations: an object can only be released if it was the most recently allocated object that is still allocated.
Public Functions
-
void set_batch_indices(std::span<const Index> indices)¶
Sets the indices that distinguish otherwise equal tensors (batching).
-
void release(const Tensor &tensor, std::string_view action)¶
- Parameters:
action – Name of the action causing the release (for diagnostics)
- Throws:
Exception – if the tensor is not the top of the stack
-
void set_batch_indices(std::span<const Index> indices)¶