pub struct Sam3CompiledDecoder {
pub batch: usize,
pub hw: usize,
pub seq: usize,
/* private fields */
}Expand description
Compile-once-per-layer decoder, runnable across many frames.
Fields§
§batch: usize§hw: usize§seq: usizeImplementations§
Source§impl Sam3CompiledDecoder
impl Sam3CompiledDecoder
pub fn new( weights: &Sam3DecoderWeights, batch: usize, hw: usize, seq: usize, device: Device, ) -> Result<Sam3CompiledDecoder, Error>
pub fn new_with_profile( weights: &Sam3DecoderWeights, batch: usize, hw: usize, seq: usize, device: Device, profile: &CompileProfile, ) -> Result<Sam3CompiledDecoder, Error>
pub fn new_with_profile_and_gguf( weights: &Sam3DecoderWeights, batch: usize, hw: usize, seq: usize, device: Device, profile: &CompileProfile, gguf_packed: Option<&GgufPackedParams>, ) -> Result<Sam3CompiledDecoder, Error>
Sourcepub fn run(
&mut self,
memory: &[f32],
memory_pos: &[f32],
text_seq_first: &[f32],
text_kpm: &[u8],
h: usize,
w: usize,
) -> Result<(Vec<f32>, Vec<f32>, Vec<f32>, Vec<f32>), Error>
pub fn run( &mut self, memory: &[f32], memory_pos: &[f32], text_seq_first: &[f32], text_kpm: &[u8], h: usize, w: usize, ) -> Result<(Vec<f32>, Vec<f32>, Vec<f32>, Vec<f32>), Error>
Run the decoder. Inputs are batch-first: memory [B, hw, D],
memory_pos [B, hw, D], text [B, seq, D] (note: text is
batch-first here, not seq-first), text_kpm (1 = PAD).
Auto Trait Implementations§
impl !RefUnwindSafe for Sam3CompiledDecoder
impl !Sync for Sam3CompiledDecoder
impl !UnwindSafe for Sam3CompiledDecoder
impl Freeze for Sam3CompiledDecoder
impl Send for Sam3CompiledDecoder
impl Unpin for Sam3CompiledDecoder
impl UnsafeUnpin for Sam3CompiledDecoder
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