class_docstr: Decoder layer block.
  
  In the original paper each operation (multi-head attention, encoder
  attention or FFN) is postprocessed with: `dropout -> add residual ->
  layernorm`. In the tensor2tensor code they suggest that learning is more
  robust when preprocessing each layer with layernorm and postprocessing with:
  `dropout -> add residual`. We default to the approach in the paper, but the
  tensor2tensor approach can be enabled by setting
  *cfg.decoder.normalize_before* to ``True``.
  
  Args:
      args (argparse.Namespace): parsed command-line arguments
      no_encoder_attn (bool, optional): whether to attend to encoder outputs
          (default: False).
class_docstr_tok: ["Decoder","layer","block",".","In","the","original","paper","each","operation","(","multi-head","attention",",","encoder","attention","or","FFN",")","is","postprocessed","with",":","`","dropout","-",">","add","residual","-",">","layernorm","`",".","In","the","tensor2tensor","code","they","suggest","that","learning","is","more","robust","when","preprocessing","each","layer","with","layernorm","and","postprocessing","with",":","`","dropout","-",">","add","residual","`",".","We","default","to","the","approach","in","the","paper",",","but","the","tensor2tensor","approach","can","be","enabled","by","setting","*","cfg.decoder.normalize_before","*","to","``","True","``",".","Args",":","args","(","argparse.Namespace",")",":","parsed","command-line","arguments","no_encoder_attn","(","bool",",","optional",")",":","whether","to","attend","to","encoder","outputs","(","default",":","False",")","."]
code: def make_generation_fast_(self, need_attn: bool = False, **kwargs):
      self.need_attn = need_attn
  
imports: from typing import Dict, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from fairseq import utils
  from fairseq.models.transformer import TransformerConfig
  from fairseq.modules import LayerNorm, MultiheadAttention
  from fairseq.modules.fairseq_dropout import FairseqDropout
  from fairseq.modules.quant_noise import quant_noise
label_desc: Use image node_id 9 for calling the TransformerDecoderLayerBase obj's underlying member method code with example usage: obj.make_generation_fast_(need_attn) without return types