pub struct Qwen3Model { /* private fields */ }Available on crate feature
qwen3 only.Implementations§
Source§impl Qwen3Model
impl Qwen3Model
pub fn new(cfg: Config, vb: VarBuilder<'_>) -> Result<Self>
pub fn embed_tokens(&self, input_ids: &Tensor) -> Result<Tensor>
pub fn forward_with_inputs_embeds( &self, inputs_embeds: &Tensor, attention_mask_4d: Option<&Tensor>, deepstack_additions: Option<&[Tensor]>, position_ids: Option<&Tensor>, ) -> Result<Tensor>
Sourcepub fn forward(
&self,
input_ids: &Tensor,
attention_mask_4d: Option<&Tensor>,
) -> Result<Tensor>
pub fn forward( &self, input_ids: &Tensor, attention_mask_4d: Option<&Tensor>, ) -> Result<Tensor>
input_ids: [B,T] attention_mask: optionally [B,T] (1=token,0=pad) OR already expanded additive mask [B,1,T,T] Here we assume additive mask [B,1,T,T] for simplicity (HF does that).
pub fn config(&self) -> &Config
pub fn device(&self) -> &Device
Auto Trait Implementations§
impl !RefUnwindSafe for Qwen3Model
impl !UnwindSafe for Qwen3Model
impl Freeze for Qwen3Model
impl Send for Qwen3Model
impl Sync for Qwen3Model
impl Unpin for Qwen3Model
impl UnsafeUnpin for Qwen3Model
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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