pub enum ClassToken {
Start,
Middle,
End,
Custom(usize),
}Expand description
Position marker for a learnable class token inserted into a network’s input sequence (embedding width = the network input width / “d_input”).
Variants§
Start
Prepend before the whole sequence (index 0).
Middle
Insert at the middle of the original sequence (index L/2).
Incompatible with step() calls.
End
Append after the whole sequence (index L).
Incompatible with step() calls.
Custom(usize)
Insert at an explicit index into the original sequence.
Trait Implementations§
Source§impl ClassMarker for ClassToken
impl ClassMarker for ClassToken
Source§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.Source§fn group_rank(&self) -> usize
fn group_rank(&self) -> usize
Tie-break rank among markers sharing an index (
Start<Middle<End<Custom).Source§fn forbids_step(&self) -> bool
fn forbids_step(&self) -> bool
Whether this marker is incompatible with single-token
step()
(Middle/End create positions a per-token recurrence cannot reproduce).Source§impl Clone for ClassToken
impl Clone for ClassToken
Source§impl Config for ClassToken
impl Config for ClassToken
§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Debug for ClassToken
impl Debug for ClassToken
Source§impl<'de> Deserialize<'de> for ClassToken
impl<'de> Deserialize<'de> for ClassToken
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
Source§impl Display for ClassToken
impl Display for ClassToken
Auto Trait Implementations§
impl Freeze for ClassToken
impl RefUnwindSafe for ClassToken
impl Send for ClassToken
impl Sync for ClassToken
impl Unpin for ClassToken
impl UnsafeUnpin for ClassToken
impl UnwindSafe for ClassToken
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