core/nn/transformer_decoder library

Stack of TransformerDecoderBlocks with an optional final LayerNorm.

This is the "seq2seq decoder" (masked self-attention + cross- attention + FFN, per block). It takes a decoder-side hidden state x and an encoder-side memory and returns contextualized decoder representations of the same shape as x.

No token/positional embeddings and no LM head — the caller is expected to prepend those. See EncoderDecoderTransformer for a full seq2seq wrapper.