pub struct CausalExample {
pub input_ids: Vec<i64>,
pub labels: Vec<i64>,
}Available on crate feature
std only.Expand description
One already-encoded document with caller-declared supervision.
Fields§
§input_ids: Vec<i64>Nonnegative actual tokenizer IDs, without batch-padding tokens.
labels: Vec<i64>Explicit token targets or the collator’s selected ignore_index.
Implementations§
Trait Implementations§
Source§impl<B: Backend> Batcher<B, CausalExample, Result<CausalBatch<B>, CausalDataError>> for CausalBatcher
Available on crate feature dataset only.
impl<B: Backend> Batcher<B, CausalExample, Result<CausalBatch<B>, CausalDataError>> for CausalBatcher
Available on crate feature
dataset only.Source§fn batch(
&self,
items: Vec<CausalExample>,
device: &B::Device,
) -> Result<CausalBatch<B>, CausalDataError>
fn batch( &self, items: Vec<CausalExample>, device: &B::Device, ) -> Result<CausalBatch<B>, CausalDataError>
Batches the given items on the specified device. Read more
Source§impl Clone for CausalExample
impl Clone for CausalExample
Source§impl Debug for CausalExample
impl Debug for CausalExample
Source§impl<'de> Deserialize<'de> for CausalExample
impl<'de> Deserialize<'de> for CausalExample
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 CausalExample
Source§impl PartialEq for CausalExample
impl PartialEq for CausalExample
Source§impl Serialize for CausalExample
impl Serialize for CausalExample
impl StructuralPartialEq for CausalExample
Auto Trait Implementations§
impl Freeze for CausalExample
impl RefUnwindSafe for CausalExample
impl Send for CausalExample
impl Sync for CausalExample
impl Unpin for CausalExample
impl UnsafeUnpin for CausalExample
impl UnwindSafe for CausalExample
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.