Struct syntaxdot_transformers::models::roberta::RobertaEmbeddings
source · [−]pub struct RobertaEmbeddings { /* private fields */ }
Expand description
RoBERTa and XLM-RoBERTa embeddings.
Implementations
sourceimpl 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
sourceimpl Debug for RobertaEmbeddings
impl Debug for RobertaEmbeddings
sourceimpl FallibleModuleT for RobertaEmbeddings
impl FallibleModuleT for RobertaEmbeddings
Auto Trait Implementations
impl RefUnwindSafe for RobertaEmbeddings
impl Send for RobertaEmbeddings
impl !Sync for RobertaEmbeddings
impl Unpin for RobertaEmbeddings
impl UnwindSafe for RobertaEmbeddings
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