pub struct DevPenalty { /* private fields */ }Implementations§
Source§impl DevPenalty
impl DevPenalty
Sourcepub fn try_new(
repeat: f32,
freq: f32,
present: f32,
counts: Vec<(u32, u32)>,
) -> Result<Self, &'static str>
pub fn try_new( repeat: f32, freq: f32, present: f32, counts: Vec<(u32, u32)>, ) -> Result<Self, &'static str>
Checked constructor for callers that do not already own a unique count map.
Sourcepub unsafe fn from_unique_counts_unchecked(
repeat: f32,
freq: f32,
present: f32,
counts: Vec<(u32, u32)>,
) -> Self
pub unsafe fn from_unique_counts_unchecked( repeat: f32, freq: f32, present: f32, counts: Vec<(u32, u32)>, ) -> Self
Zero-copy validation seam for a producer that already owns a unique count map.
§Safety
counts must contain each token id at most once and every count must be positive. The
batched kernel assigns one CUDA thread to each entry and performs a non-atomic
read/modify/write of that token’s logit.
Trait Implementations§
Source§impl Clone for DevPenalty
impl Clone for DevPenalty
Source§fn clone(&self) -> DevPenalty
fn clone(&self) -> DevPenalty
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DevPenalty
impl RefUnwindSafe for DevPenalty
impl Send for DevPenalty
impl Sync for DevPenalty
impl Unpin for DevPenalty
impl UnsafeUnpin for DevPenalty
impl UnwindSafe for DevPenalty
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