pub struct DecodeOutput {
pub logits: TensorRef,
pub kv_cache: Arc<dyn KvCacheHandle>,
pub hidden_state: Option<TensorRef>,
pub attention_weights: Option<Vec<TensorRef>>,
}Expand description
Output from decode phase
Fields§
§logits: TensorRefLogits for next token [batch_size, vocab_size]
kv_cache: Arc<dyn KvCacheHandle>Updated KV cache with new token state
Hidden state for current token (optional)
attention_weights: Option<Vec<TensorRef>>Attention weights for current token (optional)
Implementations§
Source§impl DecodeOutput
impl DecodeOutput
Sourcepub fn new(logits: TensorRef, kv_cache: Arc<dyn KvCacheHandle>) -> Self
pub fn new(logits: TensorRef, kv_cache: Arc<dyn KvCacheHandle>) -> Self
Create new decode output
Trait Implementations§
Source§impl Clone for DecodeOutput
impl Clone for DecodeOutput
Source§fn clone(&self) -> DecodeOutput
fn clone(&self) -> DecodeOutput
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 DecodeOutput
impl !RefUnwindSafe for DecodeOutput
impl Send for DecodeOutput
impl Sync for DecodeOutput
impl Unpin for DecodeOutput
impl UnsafeUnpin for DecodeOutput
impl !UnwindSafe for DecodeOutput
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