class_docstr: Transformer decoder model.
      
class_docstr_tok: ["Transformer","decoder","model","."]
code: def forward(
      self,
      dec_input,
      dec_attn_mask,
      enc_output,
      enc_attn_mask,
      layer_past=None,
      get_key_value=False,
      dec_self_attention_relative_position_bias=None,
      dec_cross_attention_relative_position_bias=None,
  ):
      # convert to Megatron mask
      dec_attn_mask_3d = build_attention_mask_3d(
          source_mask=dec_attn_mask,
          target_mask=dec_attn_mask,
          attn_mask_type=self.model_attn_mask_type,
      )
      enc_dec_attn_mask_3d = build_attention_mask_3d(
          source_mask=dec_attn_mask,
          target_mask=enc_attn_mask,
          attn_mask_type=AttnMaskType.padding,
      )
  
      # transformer decoder
      dec_output = self.model(
          dec_input,
          attn_mask_postprocess(dec_attn_mask_3d),
          layer_past=layer_past,
          get_key_value=get_key_value,
          encoder_output=enc_output,
          enc_dec_attn_mask=attn_mask_postprocess(enc_dec_attn_mask_3d),
          self_attention_relative_position_bias=dec_self_attention_relative_position_bias,
          cross_attention_relative_position_bias=dec_cross_attention_relative_position_bias,
      )
  
      return dec_output
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/megatron_transformer_decoder.py
imports: from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.megatron_decoder_module import MegatronDecoderModule
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.transformer import ParallelTransformer
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, attn_mask_postprocess, build_attention_mask_3d
  from nemo.core.classes.exportable import Exportable
label_desc: Use image node_id 3 for calling the MegatronTransformerDecoderModule obj's underlying member method code with example usage: obj.forward(dec_input, dec_attn_mask, enc_output, enc_attn_mask, layer_past, get_key_value, dec__attention_relative_position_bias, dec_cross_attention_relative_position_bias) and returns: dec_output