class_docstr: Bert Language model.
code: def forward(
      self,
      bert_model_input,
      attention_mask,
      tokentype_ids=None,
      lm_labels=None,
  ):
      with self.forward_context():
          extended_attention_mask = bert_extended_attention_mask(
              attention_mask
          )
          input_ids = bert_model_input
          position_ids = bert_position_ids(input_ids)
  
          lm_output = self.language_model(
              input_ids,
              position_ids,
              extended_attention_mask,
              tokentype_ids=tokentype_ids,
          )
  
          if self.post_process and self.add_binary_head:
              lm_output, pooled_output = lm_output
          else:
              pooled_output = None
  
          if self.post_process:
              return post_language_model_processing(
                  lm_output,
                  pooled_output,
                  self.lm_head,
                  self.binary_head,
                  lm_labels,
                  self.word_embeddings_weight(),
                  self.fp16_lm_cross_entropy,
              )
          else:
              return lm_output
  
imports: import contextlib
  import torch
  from apex.transformer import tensor_parallel
  from apex.transformer.enums import AttnMaskType
  from apex.transformer.enums import ModelType
  from apex.transformer.layers import FusedLayerNorm
  from apex.transformer.testing.global_vars import get_args
  from apex.transformer.testing.standalone_transformer_lm import MegatronModule, get_language_model, get_linear_layer, init_method_normal, scaled_init_method_normal, parallel_lm_logits
label_desc: Use image node_id 3 for calling the BertModel obj's underlying member method code with example usage: obj.forward(bert_model_input, attention_mask, tokentype_ids, lm_labels) and returns: post_language_model_processing, lm_output