pub struct Chain { /* private fields */ }Expand description
Applies a sequence of logit filters in series.
Implementations§
Source§impl Chain
impl Chain
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty logits filter chain.
An empty chain returns input logits unmodified.
Sourcepub fn append<F: LogitsFilter + 'static>(self, filter: F) -> Self
pub fn append<F: LogitsFilter + 'static>(self, filter: F) -> Self
Add a new filter to the chain.
Sourcepub fn temperature(self, temp: f32) -> Self
pub fn temperature(self, temp: f32) -> Self
Add a temperature filter to the chain. See Temperature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chain
impl !RefUnwindSafe for Chain
impl !Send for Chain
impl !Sync for Chain
impl Unpin for Chain
impl !UnwindSafe for Chain
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