pub struct AcceptDecision {
pub accepted: Vec<u32>,
pub corrected: Option<u32>,
}Expand description
Outcome of one speculative-decoding round.
Fields§
§accepted: Vec<u32>Tokens accepted. Length is 0..=n.
corrected: Option<u32>One extra token sampled from the target’s distribution
after rejection — None only when all n are accepted.
Either way the round produces accepted.len() + 1 real
tokens (the +1 is corrected or a final target sample).
Implementations§
Source§impl AcceptDecision
impl AcceptDecision
Sourcepub fn total_tokens(&self) -> usize
pub fn total_tokens(&self) -> usize
Total real tokens this round produced.
Trait Implementations§
Source§impl Clone for AcceptDecision
impl Clone for AcceptDecision
Source§fn clone(&self) -> AcceptDecision
fn clone(&self) -> AcceptDecision
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 Freeze for AcceptDecision
impl RefUnwindSafe for AcceptDecision
impl Send for AcceptDecision
impl Sync for AcceptDecision
impl Unpin for AcceptDecision
impl UnsafeUnpin for AcceptDecision
impl UnwindSafe for AcceptDecision
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more