code: def post_language_model_processing(
      lm_output,
      pooled_output,
      lm_head,
      binary_head,
      lm_labels,
      logit_weights,
      fp16_lm_cross_entropy,
  ):
      # Output.
      lm_logits = lm_head(lm_output, logit_weights)
  
      binary_logits = None
      if binary_head is not None:
          binary_logits = binary_head(pooled_output)
  
      if lm_labels is None:
          # [s b h] => [b s h]
          return lm_logits.transpose(0, 1).contiguous(), binary_logits
      else:
          # [b s] => [s b]
          lm_labels = lm_labels.transpose(0, 1).contiguous()
          # lm_logits : [s, b, h] and lm_labels: [s, b]
          if fp16_lm_cross_entropy:
              assert lm_logits.dtype == torch.half
              lm_loss = tensor_parallel.vocab_parallel_cross_entropy(
                  lm_logits, lm_labels
              )
          else:
              lm_loss = tensor_parallel.vocab_parallel_cross_entropy(
                  lm_logits.float(), lm_labels
              )
          # [s, b] => [b s]
          lm_loss = lm_loss.transpose(0, 1).contiguous()
          return lm_loss, binary_logits
  
imports: import torch
  from megatron import get_args
  from megatron.core import tensor_parallel
  from megatron.model.enums import AttnMaskType
  from megatron.model.language_model import parallel_lm_logits
  from megatron.model.language_model import get_language_model
  from megatron.model.utils import get_norm
  from megatron.model.utils import openai_gelu, erf_gelu
  from megatron.model.utils import get_linear_layer
  from megatron.model.utils import init_method_normal
  from megatron.model.utils import scaled_init_method_normal
  from .module import MegatronModule
label_desc: Use image node_id 3 for calling a global function with example usage: post_language_model_processing(lm_output, pooled_output, lm_head, binary_head, lm_labels, logit_weights, fp16_lm_cross_entropy) and returns: lm_logits,  binary_logits, lm_loss,  binary_logits