class_docstr: Decoder layer block.
  
  See "Megatron-LM: https://arxiv.org/pdf/1909.08053.pdf" for more details.
class_docstr_tok: ["Decoder","layer","block",".","See","``","Megatron-LM",":","https",":","\/\/arxiv.org\/pdf\/1909.08053.pdf","''","for","more","details","."]
code: def build_encoder_attention(self, embed_dim, args, **unused_kwargs):
      return ModelParallelMultiheadAttention(
          embed_dim=embed_dim,
          num_heads=args.decoder_attention_heads,
          kdim=getattr(args, "encoder_embed_dim", None),
          vdim=getattr(args, "encoder_embed_dim", None),
          dropout=args.attention_dropout,
          encoder_decoder_attention=True,
      )
  
file_path: fairseq/fairseq/model_parallel/modules/transformer_layer.py
imports: from fairseq.model_parallel.modules import ModelParallelMultiheadAttention
  from fairseq.modules import TransformerDecoderLayer, TransformerEncoderLayer
label_desc: Use image node_id 4 for calling the ModelParallelTransformerDecoderLayer obj's underlying member method code with example usage: obj.build_encoder_attention(embed_dim, args) and returns: ModelParallelMultiheadAttention