pub struct CodePredictorEngine { /* private fields */ }Implementations§
Source§impl CodePredictorEngine
impl CodePredictorEngine
pub fn open( store: &Qwen3TtsWeightStore, cp: &CodePredictorConfig, device: Device, ) -> Result<CodePredictorEngine, Error>
pub fn is_eager(&self) -> bool
Sourcepub fn talker_codec_flat(&self) -> (&[f32], usize)
pub fn talker_codec_flat(&self) -> (&[f32], usize)
Talker codec embedding table flat (row-major [codec_vocab, hidden]).
Used by the speculative path to do cheap g0 group-embedding swaps when
synthesising verifier inputs from drafted g0 proposals.
pub fn device(&self) -> Device
pub fn cp_backend_label(&self) -> String
pub fn warmup(&mut self, max_frames: usize) -> Result<(), Error>
pub fn predict_groups_slice( &mut self, talker_hidden: &[f32], group0: u32, ) -> Result<Vec<u32>, Error>
Sourcepub fn predict_groups_fill_emb(
&mut self,
talker_hidden: &[f32],
group0: u32,
pad: &[f32],
codec_emb: &mut [f32],
) -> Result<Vec<u32>, Error>
pub fn predict_groups_fill_emb( &mut self, talker_hidden: &[f32], group0: u32, pad: &[f32], codec_emb: &mut [f32], ) -> Result<Vec<u32>, Error>
CP predict + codec embed sum + pad (fused on eager).
pub fn predict_groups( &mut self, talker_hidden: ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>, group0: u32, ) -> Result<Vec<u32>, Error>
Sourcepub fn sum_codec_groups_into(
&self,
groups: &[u32],
out: &mut [f32],
) -> Result<(), Error>
pub fn sum_codec_groups_into( &self, groups: &[u32], out: &mut [f32], ) -> Result<(), Error>
Sum codec group embeddings into out (group 0 = talker table).
pub fn sum_codec_groups(&self, groups: &[u32]) -> Result<Vec<f32>, Error>
Sourcepub fn cp_step_embeds_from_groups(
&self,
groups: &[u32],
) -> Result<Vec<Vec<f32>>, Error>
pub fn cp_step_embeds_from_groups( &self, groups: &[u32], ) -> Result<Vec<Vec<f32>>, Error>
Per-step codec embeds for fused backbone (groups[1..] → cp_step_embed_{i}).
pub fn codec_embed_row( &self, group_idx: usize, token: u32, ) -> Result<Vec<f32>, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for CodePredictorEngine
impl !Sync for CodePredictorEngine
impl !UnwindSafe for CodePredictorEngine
impl Freeze for CodePredictorEngine
impl Send for CodePredictorEngine
impl Unpin for CodePredictorEngine
impl UnsafeUnpin for CodePredictorEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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