pub struct MPNetEmbeddings {
pub padding_idx: u32,
/* private fields */
}Fields§
§padding_idx: u32Implementations§
Source§impl MPNetEmbeddings
impl MPNetEmbeddings
Sourcepub fn load(vb: VarBuilder<'_>, config: &MPNetConfig) -> Result<Self>
pub fn load(vb: VarBuilder<'_>, config: &MPNetConfig) -> Result<Self>
Sourcepub fn forward(
&self,
input_ids: &Tensor,
position_ids: Option<&Tensor>,
inputs_embeds: Option<&Tensor>,
is_train: bool,
) -> Result<Tensor>
pub fn forward( &self, input_ids: &Tensor, position_ids: Option<&Tensor>, inputs_embeds: Option<&Tensor>, is_train: bool, ) -> Result<Tensor>
Performs a forward pass of the MPNetEmbeddings.
§Arguments
input_ids- The input tensor.position_ids- The position ids tensor.inputs_embeds- The inputs embeddings tensor.is_train- A boolean indicating whether the model is in training mode.
§Returns
Tensor- The result tensor after the forward pass.
Auto Trait Implementations§
impl Freeze for MPNetEmbeddings
impl !RefUnwindSafe for MPNetEmbeddings
impl Send for MPNetEmbeddings
impl Sync for MPNetEmbeddings
impl Unpin for MPNetEmbeddings
impl !UnwindSafe for MPNetEmbeddings
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