[][src]Enum finalfusion::prelude::VocabWrap

pub enum VocabWrap {
    SimpleVocab(SimpleVocab),
    ExplicitSubwordVocab(ExplicitSubwordVocab),
    FastTextSubwordVocab(FastTextSubwordVocab),
    BucketSubwordVocab(BucketSubwordVocab),
}

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)
BucketSubwordVocab(BucketSubwordVocab)

Trait Implementations

impl Clone for VocabWrap[src]

impl Debug for VocabWrap[src]

impl Eq for VocabWrap[src]

impl From<SimpleVocab> for VocabWrap[src]

impl From<SubwordVocab<ExplicitIndexer>> for VocabWrap[src]

impl From<SubwordVocab<FastTextIndexer>> for VocabWrap[src]

impl From<SubwordVocab<HashIndexer<FnvHasher>>> for VocabWrap[src]

impl PartialEq<VocabWrap> for VocabWrap[src]

impl StructuralEq for VocabWrap[src]

impl StructuralPartialEq for VocabWrap[src]

impl Vocab for VocabWrap[src]

fn words_len(&self) -> usize[src]

Get the vocabulary size.

fn words(&self) -> &[String][src]

Get the words in the vocabulary.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,