pub struct TopKProcessor {
pub k: usize,
}Expand description
Top-k filtering processor
Fields§
§k: usizeImplementations§
Source§impl TopKProcessor
impl TopKProcessor
pub fn new(k: usize) -> TopKProcessor
Trait Implementations§
Source§impl LogitsProcessor for TopKProcessor
impl LogitsProcessor for TopKProcessor
Source§fn process(&self, ctx: &mut SamplingContext<'_>) -> Result<(), FerrumError>
fn process(&self, ctx: &mut SamplingContext<'_>) -> Result<(), FerrumError>
Process logits in-place
Source§fn priority(&self) -> ProcessorPriority
fn priority(&self) -> ProcessorPriority
Whether this processor should be applied before others
Auto Trait Implementations§
impl Freeze for TopKProcessor
impl RefUnwindSafe for TopKProcessor
impl Send for TopKProcessor
impl Sync for TopKProcessor
impl Unpin for TopKProcessor
impl UnsafeUnpin for TopKProcessor
impl UnwindSafe for TopKProcessor
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