class_docstr: Transformer encoder model.
class_docstr_tok: ["Transformer","encoder","model","."]
code: def forward(
      self,
      enc_input,
      enc_attn_mask,
      layer_past=None,
      get_key_value=False,
      enc_self_attention_relative_position_bias=None,
  ):
      # convert to Megatron mask
      if self.use_flash_attention:
          enc_attn_mask_3d = enc_attn_mask < 0.5
      else:
          enc_attn_mask_3d = attn_mask_postprocess(
              build_attention_mask_3d(
                  source_mask=enc_attn_mask,
                  target_mask=enc_attn_mask,
                  attn_mask_type=self.model_attn_mask_type,
              )
          )
  
      # transformer encoder
      enc_output = self.model(
          enc_input,
          enc_attn_mask_3d,
          layer_past=layer_past,
          get_key_value=get_key_value,
          self_attention_relative_position_bias=enc_self_attention_relative_position_bias,
          cross_attention_relative_position_bias=None,
      )
  
      return enc_output
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/megatron_transformer_encoder.py
imports: from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.megatron_encoder_module import MegatronEncoderModule
  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 MegatronTransformerEncoderModule obj's underlying member method code with example usage: obj.forward(enc_input, enc_attn_mask, layer_past, get_key_value, enc__attention_relative_position_bias) and returns: enc_output