pub struct RobertaEmbeddings { /* private fields */ }Expand description
RoBERTa and XLM-RoBERTa embeddings.
Implementations§
Source§impl RobertaEmbeddings
impl RobertaEmbeddings
Sourcepub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
config: &BertConfig,
) -> Result<RobertaEmbeddings, TransformerError>
pub fn new<'a>( vs: impl Borrow<PathExt<'a>>, config: &BertConfig, ) -> Result<RobertaEmbeddings, TransformerError>
Construct new RoBERTa embeddings with the given variable store and Bert 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 RobertaEmbeddings
impl Debug for RobertaEmbeddings
Auto Trait Implementations§
impl Freeze for RobertaEmbeddings
impl RefUnwindSafe for RobertaEmbeddings
impl Send for RobertaEmbeddings
impl !Sync for RobertaEmbeddings
impl Unpin for RobertaEmbeddings
impl UnwindSafe for RobertaEmbeddings
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