pub struct ModelVariant {
pub batch: usize,
pub seq: usize,
pub past_seq: Option<usize>,
pub phase: ModelPhase,
pub extra: Vec<(u32, usize)>,
}Expand description
Concrete shape bucket for compile-once / specialize-at-runtime workflows.
Fields§
§batch: usize§seq: usize§past_seq: Option<usize>§phase: ModelPhase§extra: Vec<(u32, usize)>Extra dynamic symbols beyond batch/seq/past (e.g. custom ragged axes).
Implementations§
Source§impl ModelVariant
impl ModelVariant
pub fn prefill(batch: usize, seq: usize) -> Self
Sourcepub fn decode(batch: usize, past_seq: usize, new_tokens: usize) -> Self
pub fn decode(batch: usize, past_seq: usize, new_tokens: usize) -> Self
Single-step decode: seq is the new token count (often 1); past_seq is KV length.
pub fn encoder(batch: usize, seq: usize) -> Self
pub fn with_extra(self, symbol: u32, size: usize) -> Self
Sourcepub fn dim_binding(&self) -> DimBinding
pub fn dim_binding(&self) -> DimBinding
Symbol bindings used by crate::dynamic::bind_graph / compile specialization.
Trait Implementations§
Source§impl Clone for ModelVariant
impl Clone for ModelVariant
Source§fn clone(&self) -> ModelVariant
fn clone(&self) -> ModelVariant
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 ModelVariant
impl Debug for ModelVariant
Source§impl PartialEq for ModelVariant
impl PartialEq for ModelVariant
Source§fn eq(&self, other: &ModelVariant) -> bool
fn eq(&self, other: &ModelVariant) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ModelVariant
impl StructuralPartialEq for ModelVariant
Auto Trait Implementations§
impl Freeze for ModelVariant
impl RefUnwindSafe for ModelVariant
impl Send for ModelVariant
impl Sync for ModelVariant
impl Unpin for ModelVariant
impl UnsafeUnpin for ModelVariant
impl UnwindSafe for ModelVariant
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