pub enum StorageWrap {
NdArray(NdArray),
QuantizedArray(QuantizedArray),
MmapArray(MmapArray),
}
Expand description
Storage 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§
Trait Implementations§
Source§impl From<MmapArray> for StorageWrap
impl From<MmapArray> for StorageWrap
Source§impl From<NdArray> for StorageWrap
impl From<NdArray> for StorageWrap
Source§impl From<QuantizedArray> for StorageWrap
impl From<QuantizedArray> for StorageWrap
Source§fn from(s: QuantizedArray) -> Self
fn from(s: QuantizedArray) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StorageWrap
impl RefUnwindSafe for StorageWrap
impl Send for StorageWrap
impl Sync for StorageWrap
impl Unpin for StorageWrap
impl UnwindSafe for StorageWrap
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more