pub struct BertEncoder;Expand description
BERT encoder (Devlin et al., 2018).
See BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.
Trait Implementations§
Source§impl FromHF for BertEncoder
impl FromHF for BertEncoder
Source§type Config = TransformerEncoderConfig
type Config = TransformerEncoderConfig
Model configuration.
Source§type Model = TransformerEncoder
type Model = TransformerEncoder
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 BertEncoder
impl RefUnwindSafe for BertEncoder
impl Send for BertEncoder
impl Sync for BertEncoder
impl Unpin for BertEncoder
impl UnwindSafe for BertEncoder
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