pub struct Seq2SeqExample {
pub encoder_input_ids: Vec<i64>,
pub decoder_input_ids: Vec<i64>,
pub labels: Vec<i64>,
}Available on crate feature
std only.Expand description
One actual encoded source and its explicit decoder inputs and same-position labels.
Fields§
§encoder_input_ids: Vec<i64>Actual source IDs; no implicit tokenization, BOS, EOS or separator insertion.
decoder_input_ids: Vec<i64>Actual nonempty teacher-forcing inputs, prepared by the caller’s tokenizer/model contract.
labels: Vec<i64>Label t is supervised by decoder hidden position t; no second shift is performed.
Trait Implementations§
Source§impl<B: Backend> Batcher<B, Seq2SeqExample, Result<Seq2SeqBatch<B>, Seq2SeqDataError>> for Seq2SeqBatcher
Available on crate feature dataset only.
impl<B: Backend> Batcher<B, Seq2SeqExample, Result<Seq2SeqBatch<B>, Seq2SeqDataError>> for Seq2SeqBatcher
Available on crate feature
dataset only.Source§fn batch(
&self,
items: Vec<Seq2SeqExample>,
device: &B::Device,
) -> Result<Seq2SeqBatch<B>, Seq2SeqDataError>
fn batch( &self, items: Vec<Seq2SeqExample>, device: &B::Device, ) -> Result<Seq2SeqBatch<B>, Seq2SeqDataError>
Batches the given items on the specified device. Read more
Source§impl Clone for Seq2SeqExample
impl Clone for Seq2SeqExample
Source§impl Debug for Seq2SeqExample
impl Debug for Seq2SeqExample
Source§impl<'de> Deserialize<'de> for Seq2SeqExample
impl<'de> Deserialize<'de> for Seq2SeqExample
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 Seq2SeqExample
Source§impl PartialEq for Seq2SeqExample
impl PartialEq for Seq2SeqExample
Source§impl Serialize for Seq2SeqExample
impl Serialize for Seq2SeqExample
impl StructuralPartialEq for Seq2SeqExample
Auto Trait Implementations§
impl Freeze for Seq2SeqExample
impl RefUnwindSafe for Seq2SeqExample
impl Send for Seq2SeqExample
impl Sync for Seq2SeqExample
impl Unpin for Seq2SeqExample
impl UnsafeUnpin for Seq2SeqExample
impl UnwindSafe for Seq2SeqExample
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.