Expand description
Bounded, owned tensor capture and transactional mutation during decode.
A TensorTransactions value is moved into
LlamaContextParams::with_tensor_transactions.
The resulting crate::LlamaContext owns the callback state for its complete
native lifetime. Matching tensors are synchronized by llama.cpp, copied into
Rust-owned storage, and optionally transformed. Mutable tensors are written
back exactly once only after the handler returns successfully and every
output value passes validation.
Structs§
- Tensor
Batch Row - Exact sequence and causal-position metadata for one tensor row.
- Tensor
Callback Failure - Contained callback failure returned by
crate::LlamaContext::decode. - Tensor
Selector - Exact bounded graph-node contract.
- Tensor
Shape - Validated tensor dimensions.
- Tensor
Transaction - One owned tensor transaction presented synchronously to Rust.
- Tensor
Transaction Error - Error returned by a tensor transaction handler or selector validator.
- Tensor
Transactions - Owned, bounded callback program attached to one context.
- Transactional
Tensor Capture - Complete retained typed tensor from one callback invocation.
Enums§
- Captured
Tensor Data - Typed retained tensor storage.
- Tensor
Access - Native access granted to one selected tensor.
- Tensor
Data Mut - Typed Rust-owned tensor storage supplied to a callback.
- Tensor
Element Type - Element representation required by an exact tensor selector.
- Tensor
Finite Validation - How aggressively a selector validates that
f32values are finite. - Tensor
RowMapping - Mapping between tensor rows and the submitted decode batch.
- Tensor
Writeback - Native write-back decision returned by a transaction handler.
Constants§
- MAX_
RETAINED_ TENSOR_ BYTES - Maximum retained tensor bytes from one decode.
- MAX_
TENSOR_ ELEMENTS - Maximum elements copied by one selected tensor invocation.
- MAX_
TENSOR_ FAILURE_ BYTES - Maximum retained callback failure bytes.
- MAX_
TENSOR_ NAME_ BYTES - Maximum UTF-8 bytes in one exact graph-node name.
- MAX_
TENSOR_ ROWS - Maximum rows accepted from one selected tensor invocation.
- MAX_
TENSOR_ SELECTORS - Maximum exact graph selectors attached to one context.
Traits§
- Tensor
Transaction Handler - Synchronous safe handler for selected tensor transactions.