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

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)

Tuple Fields

ExplicitSubwordVocab(ExplicitSubwordVocab)

Tuple Fields

FastTextSubwordVocab(FastTextSubwordVocab)

Tuple Fields

FloretSubwordVocab(FloretSubwordVocab)

Tuple Fields

BucketSubwordVocab(BucketSubwordVocab)

Tuple Fields

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Get the vocabulary size.

Get the words in the vocabulary.

Get the index of a token.

Get the total length of this vocabulary, including possible subword indices.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.