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