Struct syntaxdot_transformers::models::bert::BertEmbeddings
source · [−]pub struct BertEmbeddings { /* private fields */ }
Expand description
Construct the embeddings from word, position and token_type embeddings.
Implementations
sourceimpl BertEmbeddings
impl BertEmbeddings
sourcepub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
config: &BertConfig
) -> Result<Self, TransformerError>
pub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
config: &BertConfig
) -> Result<Self, TransformerError>
Construct new Bert 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 BertEmbeddings
impl Debug for BertEmbeddings
sourceimpl FallibleModuleT for BertEmbeddings
impl FallibleModuleT for BertEmbeddings
Auto Trait Implementations
impl RefUnwindSafe for BertEmbeddings
impl Send for BertEmbeddings
impl !Sync for BertEmbeddings
impl Unpin for BertEmbeddings
impl UnwindSafe for BertEmbeddings
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