pub struct TokenBatchOptions {
pub maximum_tokens: usize,
pub maximum_examples: Option<usize>,
pub layout: TokenBatchLayout,
}Available on crate feature
std only.Expand description
Explicit batch limits; these do not truncate, repeat, reorder or pad samples.
Fields§
§maximum_tokens: usizeMaximum token slots in one batch under the selected layout.
maximum_examples: Option<usize>Optional independent maximum number of actual examples in one batch.
layout: TokenBatchLayoutPacked or rectangular cost accounting; the batcher must honor this layout.
Implementations§
Source§impl TokenBatchOptions
impl TokenBatchOptions
Sourcepub fn validate_lengths(&self, lengths: &[usize]) -> Result<(), SamplerError>
pub fn validate_lengths(&self, lengths: &[usize]) -> Result<(), SamplerError>
Reject zero limits and empty/oversized sequence metadata before issuance.
Trait Implementations§
Source§impl Clone for TokenBatchOptions
impl Clone for TokenBatchOptions
Source§impl Debug for TokenBatchOptions
impl Debug for TokenBatchOptions
Source§impl<'de> Deserialize<'de> for TokenBatchOptions
impl<'de> Deserialize<'de> for TokenBatchOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TokenBatchOptions
Source§impl PartialEq for TokenBatchOptions
impl PartialEq for TokenBatchOptions
Source§impl Serialize for TokenBatchOptions
impl Serialize for TokenBatchOptions
impl StructuralPartialEq for TokenBatchOptions
Auto Trait Implementations§
impl Freeze for TokenBatchOptions
impl RefUnwindSafe for TokenBatchOptions
impl Send for TokenBatchOptions
impl Sync for TokenBatchOptions
impl Unpin for TokenBatchOptions
impl UnsafeUnpin for TokenBatchOptions
impl UnwindSafe for TokenBatchOptions
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.