Enum ClassLatent
pub enum ClassLatent {
Start,
Middle,
End,
Custom(usize),
}Expand description
Position marker for a learnable class latent inserted into a layer’s
working sequence (embedding width = d_model).
Variants§
Start
Prepend before the whole sequence (index 0).
Middle
Insert before the middle token of the original sequence (index L/2).
Needs a [ClassCursors::full_len] hint.
End
Close the sequence: appended after its last token (index L) — the
only marker that trails one instead of preceding it, and so the token a
closing step returns. Needs a [ClassCursors::full_len] hint.
Custom(usize)
Insert before the original sequence’s token index — for any index,
so one at or past the end never lands (no such token), unless the caller
feeds tokens past the announced length and it precedes the next one.
Trait Implementations§
§impl ClassMarker for ClassLatent
impl ClassMarker for ClassLatent
§fn insert_pos(&self, orig_len: usize) -> usize
fn insert_pos(&self, orig_len: usize) -> usize
Insertion index measured against the original sequence length
orig_len.§fn group_rank(&self) -> usize
fn group_rank(&self) -> usize
Tie-break rank among markers sharing an index (
Start<Middle<End<Custom).§fn needs_full_len(&self) -> bool
fn needs_full_len(&self) -> bool
Whether this marker’s position is only defined against the whole sequence
(
Middle/End), so placing it requires a [ClassCursor::full_len] hint.§fn closes_sequence(&self) -> bool
fn closes_sequence(&self) -> bool
Whether this marker closes the sequence — trailing its last token
rather than preceding one.
End alone does.§impl Clone for ClassLatent
impl Clone for ClassLatent
§fn clone(&self) -> ClassLatent
fn clone(&self) -> ClassLatent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Config for ClassLatent
impl Config for ClassLatent
§impl Debug for ClassLatent
impl Debug for ClassLatent
§impl<'de> Deserialize<'de> for ClassLatent
impl<'de> Deserialize<'de> for ClassLatent
§fn deserialize<D>(
deserializer: D,
) -> Result<ClassLatent, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ClassLatent, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ClassLatent
impl Display for ClassLatent
§impl Serialize for ClassLatent
impl Serialize for ClassLatent
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ClassLatent
impl RefUnwindSafe for ClassLatent
impl Send for ClassLatent
impl Sync for ClassLatent
impl Unpin for ClassLatent
impl UnsafeUnpin for ClassLatent
impl UnwindSafe for ClassLatent
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