pub struct SampledToken {
pub token: u32,
pub logprob: f32,
}Expand description
A sampled token and its log-probability under the model’s full-vocab distribution.
Fields§
§token: u32Sampled token id.
logprob: f32The model’s full-vocab log-probability of this token. Valid as the RL
behavior log-probability ONLY for untruncated sampling at temperature 1.0;
under any other sampler use Sampler::behavior_logprob, which describes
the actual sampling distribution (paper §5.3).
Trait Implementations§
Source§impl Clone for SampledToken
impl Clone for SampledToken
Auto Trait Implementations§
impl Forget for SampledToken
impl Freeze for SampledToken
impl RefUnwindSafe for SampledToken
impl Send for SampledToken
impl Sync for SampledToken
impl Unpin for SampledToken
impl UnsafeUnpin for SampledToken
impl UnwindSafe for SampledToken
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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