pub struct Model { /* private fields */ }Expand description
RWKV7 model.
Implementations§
Source§impl Model
impl Model
Sourcepub fn forward<'a>(
&'a self,
scratch: &'a mut ScratchBuffers,
token: u32,
state: &mut State,
) -> &'a [f32]
pub fn forward<'a>( &'a self, scratch: &'a mut ScratchBuffers, token: u32, state: &mut State, ) -> &'a [f32]
Forward pass for a single token. Returns logits for next token prediction.
Sourcepub fn forward_with_profiler<'a, S: ProfilerSink>(
&'a self,
scratch: &'a mut ScratchBuffers,
token: u32,
state: &mut State,
profiler: &mut S,
) -> &'a [f32]
pub fn forward_with_profiler<'a, S: ProfilerSink>( &'a self, scratch: &'a mut ScratchBuffers, token: u32, state: &mut State, profiler: &mut S, ) -> &'a [f32]
Forward pass that records per-layer timings through a custom sink.
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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
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