Struct syntaxdot_transformers::models::albert::AlbertEmbeddings
source · [−]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
sourceimpl 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
sourceimpl Debug for AlbertEmbeddings
impl Debug for AlbertEmbeddings
sourceimpl FallibleModuleT for AlbertEmbeddings
impl FallibleModuleT for AlbertEmbeddings
Auto Trait Implementations
impl RefUnwindSafe for AlbertEmbeddings
impl Send for AlbertEmbeddings
impl !Sync for AlbertEmbeddings
impl Unpin for AlbertEmbeddings
impl UnwindSafe for AlbertEmbeddings
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more