pub struct PaddedTokenBatch<B: Backend> {
pub input_ids: Tensor<B, 2, Int>,
pub attention_mask: Tensor<B, 2, Bool>,
pub position_ids: Tensor<B, 2, Int>,
pub lengths: Vec<usize>,
}Available on crate feature
std only.Expand description
Actual padded token inputs without labels, for a model’s encoder or decoder.
Fields§
§input_ids: Tensor<B, 2, Int>[examples,maximum actual length], including explicitly masked padding cells.
attention_mask: Tensor<B, 2, Bool>True exactly at actual input tokens, not a supervision/prompt mask.
position_ids: Tensor<B, 2, Int>Actual per-document reset positions, with zero in masked padding cells.
lengths: Vec<usize>Original lengths in actual paired example order.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for PaddedTokenBatch<B>
impl<B> RefUnwindSafe for PaddedTokenBatch<B>
impl<B> Send for PaddedTokenBatch<B>
impl<B> Sync for PaddedTokenBatch<B>
impl<B> Unpin for PaddedTokenBatch<B>
impl<B> UnsafeUnpin for PaddedTokenBatch<B>
impl<B> UnwindSafe for PaddedTokenBatch<B>
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