pub struct EncodedSequence {
pub ids: Vec<u32>,
pub type_ids: Vec<u32>,
pub special_tokens_mask: Vec<u32>,
}Expand description
One unpadded sequence, including post-processor special tokens.
Fields§
§ids: Vec<u32>Vocabulary IDs.
type_ids: Vec<u32>Segment/type identifiers aligned to IDs.
special_tokens_mask: Vec<u32>One for special tokens, zero for ordinary tokens.
Implementations§
Trait Implementations§
Source§impl Clone for EncodedSequence
impl Clone for EncodedSequence
Source§impl Collate<EncodedSequence> for TextCollator
impl Collate<EncodedSequence> for TextCollator
Source§impl Debug for EncodedSequence
impl Debug for EncodedSequence
Source§impl DefaultConvert for EncodedSequence
impl DefaultConvert for EncodedSequence
Source§type Output = EncodedSequence
type Output = EncodedSequence
Output produced from this sample type.
Source§fn default_convert(self) -> Result<Self, CollateError>
fn default_convert(self) -> Result<Self, CollateError>
Applies built-in conversion without automatic batching.
Source§impl<'de> Deserialize<'de> for EncodedSequence
impl<'de> Deserialize<'de> for EncodedSequence
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 EncodedSequence
Source§impl MemoryFootprint for EncodedSequence
impl MemoryFootprint for EncodedSequence
Source§fn resident_bytes(&self) -> usize
fn resident_bytes(&self) -> usize
Returns the conservative logical payload size in bytes.
Source§impl PartialEq for EncodedSequence
impl PartialEq for EncodedSequence
Source§impl Serialize for EncodedSequence
impl Serialize for EncodedSequence
impl StructuralPartialEq for EncodedSequence
Auto Trait Implementations§
impl Forget for EncodedSequence
impl Freeze for EncodedSequence
impl RefUnwindSafe for EncodedSequence
impl Send for EncodedSequence
impl Sync for EncodedSequence
impl Unpin for EncodedSequence
impl UnsafeUnpin for EncodedSequence
impl UnwindSafe for EncodedSequence
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<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