pub struct Qwen3Encoder {
pub hidden: usize,
/* private fields */
}Fields§
Implementations§
Source§impl Qwen3Encoder
impl Qwen3Encoder
pub fn from_cmf(model: &Arc<CmfModel>) -> Result<Self, String>
Sourcepub fn encode(&self, ids: &[u32]) -> Vec<f32>
pub fn encode(&self, ids: &[u32]) -> Vec<f32>
Causal full-sequence forward. Returns [n, hidden] — the
residual stream leaving the last layer, normed only if the
config says the checkpoint has a final norm (H3’s does not).
Sourcepub fn encode_with_images(
&self,
ids: &[u32],
spans: &[ImageSpan],
embeds: &[Vec<f32>],
deepstack: &[Vec<f32>],
) -> Vec<f32>
pub fn encode_with_images( &self, ids: &[u32], spans: &[ImageSpan], embeds: &[Vec<f32>], deepstack: &[Vec<f32>], ) -> Vec<f32>
Full forward with images. embeds replaces the token embedding
at [span.start, span.start + span.len) with the vision tower’s
merged tokens; deepstack[k] is added at the visual positions
after LM layer k — the first layers, not the vision layers the
features were taken from.
Width of what encode returns — the DiT’s conditioning width,
which is the projection’s output when one is packed and the
encoder’s own hidden size otherwise.
Auto Trait Implementations§
impl !RefUnwindSafe for Qwen3Encoder
impl !UnwindSafe for Qwen3Encoder
impl Freeze for Qwen3Encoder
impl Send for Qwen3Encoder
impl Sync for Qwen3Encoder
impl Unpin for Qwen3Encoder
impl UnsafeUnpin for Qwen3Encoder
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