pub struct PrefillOutput {
pub logits: TensorRef,
pub kv_cache: Arc<dyn KvCacheHandle>,
pub recurrent_state: Option<Arc<dyn RecurrentStateHandle>>,
pub hidden_states: Option<Vec<TensorRef>>,
pub attention_weights: Option<Vec<TensorRef>>,
}Expand description
Output from prefill phase
Fields§
§logits: TensorRefLogits for all positions [batch_size, sequence_length, vocab_size]
kv_cache: Arc<dyn KvCacheHandle>KV cache handle populated with prompt states
recurrent_state: Option<Arc<dyn RecurrentStateHandle>>Recurrent-state handle populated with prompt state, when used.
Hidden states at each layer (optional, for analysis)
attention_weights: Option<Vec<TensorRef>>Attention weights (optional, for analysis)
Implementations§
Source§impl PrefillOutput
impl PrefillOutput
Sourcepub fn new(logits: TensorRef, kv_cache: Arc<dyn KvCacheHandle>) -> Self
pub fn new(logits: TensorRef, kv_cache: Arc<dyn KvCacheHandle>) -> Self
Create new prefill output
Sourcepub fn with_recurrent_state(
self,
recurrent_state: Arc<dyn RecurrentStateHandle>,
) -> Self
pub fn with_recurrent_state( self, recurrent_state: Arc<dyn RecurrentStateHandle>, ) -> Self
Attach updated recurrent state to the prefill output.
Sourcepub fn last_token_logits(&self) -> Result<TensorRef>
pub fn last_token_logits(&self) -> Result<TensorRef>
Get logits for last position (for next token generation)
Trait Implementations§
Source§impl Clone for PrefillOutput
impl Clone for PrefillOutput
Source§fn clone(&self) -> PrefillOutput
fn clone(&self) -> PrefillOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PrefillOutput
impl !UnwindSafe for PrefillOutput
impl Freeze for PrefillOutput
impl Send for PrefillOutput
impl Sync for PrefillOutput
impl Unpin for PrefillOutput
impl UnsafeUnpin for PrefillOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more