pub struct AlbertEncoder { /* private fields */ }Expand description
ALBERT encoder (Lan et al., 2019).
See ALBERT: A Lite BERT for Self-supervised Learning of Language Representations.
Trait Implementations§
Source§impl Encoder for AlbertEncoder
impl Encoder for AlbertEncoder
Source§fn forward_t(
&self,
input: &Tensor,
attention_mask: &AttentionMask,
positions: Option<&Tensor>,
type_ids: Option<&Tensor>,
train: bool,
) -> Result<EncoderOutput, BoxedError>
fn forward_t( &self, input: &Tensor, attention_mask: &AttentionMask, positions: Option<&Tensor>, type_ids: Option<&Tensor>, train: bool, ) -> Result<EncoderOutput, BoxedError>
Encode an input sequence. Read more
Source§impl FromHF for AlbertEncoder
impl FromHF for AlbertEncoder
Source§type Config = AlbertEncoderConfig
type Config = AlbertEncoderConfig
Model configuration.
Source§type Model = AlbertEncoder
type Model = AlbertEncoder
The type of model that is constructed. Read more
Source§fn rename_parameters() -> impl Fn(&str) -> String
fn rename_parameters() -> impl Fn(&str) -> String
Create a parameter renaming function. Read more
Source§fn from_hf(
hf_config: HFConfigWithDType<Self::HFConfig>,
backend: Box<dyn SimpleBackend>,
device: &Device,
) -> Result<Self::Model, FromHFError>
fn from_hf( hf_config: HFConfigWithDType<Self::HFConfig>, backend: Box<dyn SimpleBackend>, device: &Device, ) -> Result<Self::Model, FromHFError>
Construct a model from an HF model configuration and parameter backend. Read more
Auto Trait Implementations§
impl Freeze for AlbertEncoder
impl !RefUnwindSafe for AlbertEncoder
impl !Send for AlbertEncoder
impl !Sync for AlbertEncoder
impl Unpin for AlbertEncoder
impl !UnwindSafe for AlbertEncoder
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