pub struct Compat { /* private fields */ }Expand description
A compat checkpoint ready to run on the CPU.
Implementations§
Source§impl Compat
impl Compat
Sourcepub fn new(model: &Model, threads: usize) -> Self
pub fn new(model: &Model, threads: usize) -> Self
Converts the weights of model to f32, on threads threads, which the forward pass uses
too.
Sourcepub fn from_parts(
spec: &LayaSpec,
graph: &LayaGraph,
t: &Tensors,
threads: usize,
) -> Self
pub fn from_parts( spec: &LayaSpec, graph: &LayaGraph, t: &Tensors, threads: usize, ) -> Self
Compat::new from the pieces of a model.
Sourcepub fn set_threads(&mut self, threads: usize)
pub fn set_threads(&mut self, threads: usize)
Changes the number of threads the forward pass uses. The results do not change with it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Compat
impl RefUnwindSafe for Compat
impl Send for Compat
impl Sync for Compat
impl Unpin for Compat
impl UnsafeUnpin for Compat
impl UnwindSafe for Compat
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