pub struct PrefillOutput {
pub logits: TensorRef,
pub kv_cache: Arc<dyn KvCacheHandle>,
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
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 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 · 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 Freeze for PrefillOutput
impl !RefUnwindSafe for PrefillOutput
impl Send for PrefillOutput
impl Sync for PrefillOutput
impl Unpin for PrefillOutput
impl UnsafeUnpin for PrefillOutput
impl !UnwindSafe 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