pub struct RobertaEncoder;Expand description
RoBERTa encoder (Liu et al., 2019).
See RoBERTa: A Robustly Optimized BERT Pretraining Approach.
Trait Implementations§
Source§impl FromHF for RobertaEncoder
impl FromHF for RobertaEncoder
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 RobertaEncoder
impl RefUnwindSafe for RobertaEncoder
impl Send for RobertaEncoder
impl Sync for RobertaEncoder
impl Unpin for RobertaEncoder
impl UnwindSafe for RobertaEncoder
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