pub struct TransformerEncoder { /* private fields */ }Expand description
Encoder using the transformer architecture.
Trait Implementations§
Source§impl Encoder for TransformerEncoder
impl Encoder for TransformerEncoder
Source§fn forward_t(
&self,
piece_ids: &Tensor,
attention_mask: &AttentionMask,
positions: Option<&Tensor>,
type_ids: Option<&Tensor>,
train: bool,
) -> Result<EncoderOutput, BoxedError>
fn forward_t( &self, piece_ids: &Tensor, attention_mask: &AttentionMask, positions: Option<&Tensor>, type_ids: Option<&Tensor>, train: bool, ) -> Result<EncoderOutput, BoxedError>
Encode an input sequence. Read more
Auto Trait Implementations§
impl Freeze for TransformerEncoder
impl !RefUnwindSafe for TransformerEncoder
impl !Send for TransformerEncoder
impl !Sync for TransformerEncoder
impl Unpin for TransformerEncoder
impl !UnwindSafe for TransformerEncoder
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