Learn Before
Example
Seq2SeqAttentionDecoder Output Shape Verification
The Seq2SeqAttentionDecoder can be verified by instantiating a test configuration with vocab_size , embed_size , num_hiddens , and num_layers , then feeding a minibatch of sequences each with time steps. After running the encoder and initializing the decoder state, the forward pass produces an output tensor of shape (batch_size, num_steps, vocab_size) . The returned state contains the encoder outputs of shape (batch_size, num_steps, num_hiddens) and a per-layer decoder hidden state where each layer has shape (batch_size, num_hiddens) .
0
1
Updated 2026-05-14
Tags
D2L
Dive into Deep Learning @ D2L