class_docstr: Model parallel Multi-headed attention.
  This performs the Multi-headed attention over multiple gpus.
  
  See "Megatron-LM: https://arxiv.org/pdf/1909.08053.pdf" for more details.
class_docstr_tok: ["Model","parallel","Multi-headed","attention",".","This","performs","the","Multi-headed","attention","over","multiple","gpus",".","See","``","Megatron-LM",":","https",":","\/\/arxiv.org\/pdf\/1909.08053.pdf","''","for","more","details","."]
code: def _get_input_buffer(
      self,
      incremental_state: Optional[
          Dict[str, Dict[str, Optional[Tensor]]]
      ],
  ) -> Dict[str, Optional[Tensor]]:
      result = self.get_incremental_state(
          incremental_state, "attn_state"
      )
      if result is not None:
          return result
      else:
          empty_result: Dict[str, Optional[Tensor]] = {}
          return empty_result
  
file_path: fairseq/fairseq/model_parallel/modules/multihead_attention.py
imports: from typing import Dict, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from fairseq import utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from fairseq.modules.fairseq_dropout import FairseqDropout
label_desc: Use image node_id 5 for calling the ModelParallelMultiheadAttention obj's underlying member method code with example usage: obj._get_input_buffer(incremental_state) and returns: result, empty_result