pub struct PackedBatch {
pub input_ids: Vec<u32>,
pub attention_mask: Vec<u32>,
pub position_ids: Vec<u32>,
pub sequence_starts: Vec<usize>,
}Expand description
A single packed batch containing multiple sequences concatenated together.
Fields§
§input_ids: Vec<u32>Token IDs, concatenated sequences padded to fill the bin.
attention_mask: Vec<u32>Attention mask: 1 for real tokens, 0 for padding.
position_ids: Vec<u32>Position IDs: per-sequence positions starting from 0.
sequence_starts: Vec<usize>Start indices of each sequence within this batch.
Trait Implementations§
Source§impl Clone for PackedBatch
impl Clone for PackedBatch
Source§fn clone(&self) -> PackedBatch
fn clone(&self) -> PackedBatch
Returns a duplicate of the value. Read more
1.0.0 · 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 PackedBatch
impl RefUnwindSafe for PackedBatch
impl Send for PackedBatch
impl Sync for PackedBatch
impl Unpin for PackedBatch
impl UnwindSafe for PackedBatch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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