pub enum ExecutorSamplingOutput {
FullLogits(Vec<f32>),
GreedyToken(TokenId),
}Expand description
Typed product output returned by a plan-runtime execution wave.
A selected token is not a one-element logits vector. Keeping the variants distinct prevents the engine from inferring product semantics from tensor shape and lets full-logits requests retain every host-side sampler, grammar, and structured-output processor.
Variants§
Implementations§
Source§impl ExecutorSamplingOutput
impl ExecutorSamplingOutput
pub fn full_logits(logits: Vec<f32>) -> Result<Self>
pub const fn greedy_token(token: TokenId) -> Self
Sourcepub fn validate_for_policy(
&self,
policy: &LogitsReturnPolicy,
vocabulary_size: usize,
) -> Result<()>
pub fn validate_for_policy( &self, policy: &LogitsReturnPolicy, vocabulary_size: usize, ) -> Result<()>
Validate that a device-selected token was explicitly authorized.
Returning full logits for a greedy policy remains legal: heterogeneous batches may deliberately fall back to host sampling. The inverse would skip required product processors and therefore fails closed.
pub fn into_full_logits(self) -> Result<Vec<f32>>
Trait Implementations§
Source§impl Clone for ExecutorSamplingOutput
impl Clone for ExecutorSamplingOutput
Source§fn clone(&self) -> ExecutorSamplingOutput
fn clone(&self) -> ExecutorSamplingOutput
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 moreSource§impl Debug for ExecutorSamplingOutput
impl Debug for ExecutorSamplingOutput
Source§impl PartialEq for ExecutorSamplingOutput
impl PartialEq for ExecutorSamplingOutput
impl StructuralPartialEq for ExecutorSamplingOutput
Auto Trait Implementations§
impl Freeze for ExecutorSamplingOutput
impl RefUnwindSafe for ExecutorSamplingOutput
impl Send for ExecutorSamplingOutput
impl Sync for ExecutorSamplingOutput
impl Unpin for ExecutorSamplingOutput
impl UnsafeUnpin for ExecutorSamplingOutput
impl UnwindSafe for ExecutorSamplingOutput
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