pub struct Parameters<'a> { /* private fields */ }Expand description
Receives a module’s parameters during Module::visit, with their paths.
Implementations§
Source§impl<'a> Parameters<'a>
impl<'a> Parameters<'a>
Sourcepub fn new(f: &'a mut dyn FnMut(&str, &mut Array, bool)) -> Self
pub fn new(f: &'a mut dyn FnMut(&str, &mut Array, bool)) -> Self
A visitor calling f(path, parameter, trainable) for each parameter.
Sourcepub fn optional(&mut self, name: &str, a: &mut Option<Array>)
pub fn optional(&mut self, name: &str, a: &mut Option<Array>)
A trainable parameter that may be absent (an optional bias).
Sourcepub fn frozen(&mut self, name: &str, a: &mut Array)
pub fn frozen(&mut self, name: &str, a: &mut Array)
A parameter that is never trained (a quantized weight, a LoRA base).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Parameters<'a>
impl<'a> !Send for Parameters<'a>
impl<'a> !Sync for Parameters<'a>
impl<'a> !UnwindSafe for Parameters<'a>
impl<'a> Freeze for Parameters<'a>
impl<'a> Unpin for Parameters<'a>
impl<'a> UnsafeUnpin for Parameters<'a>
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