Enum finalfusion::vocab::VocabWrap
source · pub enum VocabWrap {
SimpleVocab(SimpleVocab),
ExplicitSubwordVocab(ExplicitSubwordVocab),
FastTextSubwordVocab(FastTextSubwordVocab),
FloretSubwordVocab(FloretSubwordVocab),
BucketSubwordVocab(BucketSubwordVocab),
}
Expand description
Vocabulary types wrapper.
This crate makes it possible to create fine-grained embedding
types, such as Embeddings<SimpleVocab, NdArray>
or
Embeddings<SubwordVocab, QuantizedArray>
. However, in some cases
it is more pleasant to have a single type that covers all
vocabulary and storage types. VocabWrap
and StorageWrap
wrap
all the vocabularies and storage types known to this crate such
that the type Embeddings<VocabWrap, StorageWrap>
covers all
variations.
Variants§
SimpleVocab(SimpleVocab)
ExplicitSubwordVocab(ExplicitSubwordVocab)
FastTextSubwordVocab(FastTextSubwordVocab)
FloretSubwordVocab(FloretSubwordVocab)
BucketSubwordVocab(BucketSubwordVocab)
Trait Implementations§
source§impl From<SimpleVocab> for VocabWrap
impl From<SimpleVocab> for VocabWrap
source§fn from(v: SimpleVocab) -> Self
fn from(v: SimpleVocab) -> Self
Converts to this type from the input type.
source§impl From<SubwordVocab<ExplicitIndexer>> for VocabWrap
impl From<SubwordVocab<ExplicitIndexer>> for VocabWrap
source§fn from(v: ExplicitSubwordVocab) -> Self
fn from(v: ExplicitSubwordVocab) -> Self
Converts to this type from the input type.
source§impl From<SubwordVocab<FastTextIndexer>> for VocabWrap
impl From<SubwordVocab<FastTextIndexer>> for VocabWrap
source§fn from(v: FastTextSubwordVocab) -> Self
fn from(v: FastTextSubwordVocab) -> Self
Converts to this type from the input type.
source§impl From<SubwordVocab<FloretIndexer>> for VocabWrap
impl From<SubwordVocab<FloretIndexer>> for VocabWrap
source§fn from(v: FloretSubwordVocab) -> Self
fn from(v: FloretSubwordVocab) -> Self
Converts to this type from the input type.
source§impl From<SubwordVocab<HashIndexer<FnvHasher>>> for VocabWrap
impl From<SubwordVocab<HashIndexer<FnvHasher>>> for VocabWrap
source§fn from(v: BucketSubwordVocab) -> Self
fn from(v: BucketSubwordVocab) -> Self
Converts to this type from the input type.
source§impl PartialEq for VocabWrap
impl PartialEq for VocabWrap
impl Eq for VocabWrap
impl StructuralEq for VocabWrap
impl StructuralPartialEq for VocabWrap
Auto Trait Implementations§
impl RefUnwindSafe for VocabWrap
impl Send for VocabWrap
impl Sync for VocabWrap
impl Unpin for VocabWrap
impl UnwindSafe for VocabWrap
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.