pub struct AlbertEmbeddings { /* private fields */ }Expand description
ALBERT embeddings.
These embeddings are the same as BERT embeddings. However, we do some wrapping to ensure that the right embedding dimensionality is used.
Implementations§
Source§impl AlbertEmbeddings
impl AlbertEmbeddings
Sourcepub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
config: &AlbertConfig,
) -> Result<Self, TransformerError>
pub fn new<'a>( vs: impl Borrow<PathExt<'a>>, config: &AlbertConfig, ) -> Result<Self, TransformerError>
Construct new ALBERT embeddings with the given variable store and ALBERT configuration.
pub fn forward( &self, input_ids: &Tensor, token_type_ids: Option<&Tensor>, position_ids: Option<&Tensor>, train: bool, ) -> Result<Tensor, TransformerError>
Trait Implementations§
Source§impl Debug for AlbertEmbeddings
impl Debug for AlbertEmbeddings
Auto Trait Implementations§
impl Freeze for AlbertEmbeddings
impl RefUnwindSafe for AlbertEmbeddings
impl Send for AlbertEmbeddings
impl !Sync for AlbertEmbeddings
impl Unpin for AlbertEmbeddings
impl UnwindSafe for AlbertEmbeddings
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