pub struct TransformerDecoderInput<B>where
B: Backend,{ /* private fields */ }Expand description
Transformer Decoder forward pass input argument.
Implementations§
Source§impl<B> TransformerDecoderInput<B>where
B: Backend,
impl<B> TransformerDecoderInput<B>where
B: Backend,
Sourcepub fn new(
target: Tensor<B, 3>,
memory: Tensor<B, 3>,
) -> TransformerDecoderInput<B>
pub fn new( target: Tensor<B, 3>, memory: Tensor<B, 3>, ) -> TransformerDecoderInput<B>
Create a transformer decoder input argument.
Sourcepub fn memory_mask_pad(
self,
mask_pad: Tensor<B, 2, Bool>,
) -> TransformerDecoderInput<B>
pub fn memory_mask_pad( self, mask_pad: Tensor<B, 2, Bool>, ) -> TransformerDecoderInput<B>
Register the memory padding mask.
Sourcepub fn memory_mask_attn(
self,
mask_attn: Tensor<B, 3, Bool>,
) -> TransformerDecoderInput<B>
pub fn memory_mask_attn( self, mask_attn: Tensor<B, 3, Bool>, ) -> TransformerDecoderInput<B>
Register the memory attention mask.
Sourcepub fn target_mask_pad(
self,
mask_pad: Tensor<B, 2, Bool>,
) -> TransformerDecoderInput<B>
pub fn target_mask_pad( self, mask_pad: Tensor<B, 2, Bool>, ) -> TransformerDecoderInput<B>
Register the target padding mask.
Sourcepub fn target_mask_attn(
self,
mask_attn: Tensor<B, 3, Bool>,
) -> TransformerDecoderInput<B>
pub fn target_mask_attn( self, mask_attn: Tensor<B, 3, Bool>, ) -> TransformerDecoderInput<B>
Register the target attention mask.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for TransformerDecoderInput<B>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
<B as BackendTypes>::BoolTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for TransformerDecoderInput<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::BoolTensorPrimitive: RefUnwindSafe,
impl<B> Send for TransformerDecoderInput<B>
impl<B> Sync for TransformerDecoderInput<B>
impl<B> Unpin for TransformerDecoderInput<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
<B as BackendTypes>::BoolTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for TransformerDecoderInput<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::BoolTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for TransformerDecoderInput<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
<B as BackendTypes>::BoolTensorPrimitive: UnwindSafe,
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