class_docstr: Megatron encoder-decoder base class
class_docstr_tok: ["Megatron","encoder-decoder","base","class"]
code: def _handle_bias_activation_fusion_args(self, cfg):
      # For oldest models, we don't have the option to turn on/off bias activation fusion. It is always on.
      if not hasattr(cfg, "bias_gelu_fusion") and not hasattr(
          cfg, "bias_activation_fusion"
      ):
          # Handle the case where the model can have bias=False
          if cfg.get("bias", True):
              cfg.bias_activation_fusion = True
          else:
              cfg.bias_activation_fusion = False
      # For in-between models, Re-map bias_gelu_fusion to bias_activation_fusion
      elif hasattr(cfg, "bias_gelu_fusion"):
          logging.warning(
              "bias_gelu_fusion is deprecated. Please use bias_activation_fusion instead."
          )
          cfg.bias_activation_fusion = cfg.bias_gelu_fusion
  
imports: import copy
  import functools
  import inspect
  from typing import Any, Dict, List, Optional
  import torch
  from omegaconf import OmegaConf, open_dict
  from omegaconf.dictconfig import DictConfig
  from pytorch_lightning.accelerators import CPUAccelerator
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.data.language_modeling.megatron.data_samplers import MegatronPretrainingRandomSampler, MegatronPretrainingSampler
  from nemo.collections.nlp.models.language_modeling.megatron_base_model import MegatronBaseModel
  from nemo.collections.nlp.modules.common.megatron.build_model import build_model
  from nemo.collections.nlp.modules.common.megatron.module import Float16Module
  from nemo.collections.nlp.modules.common.megatron.token_level_encoder_decoder import MegatronTokenLevelEncoderDecoderModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, average_losses_across_data_parallel_group, get_params_for_weight_decay_optimization
  from nemo.collections.nlp.modules.common.text_generation_utils import compute_beam_search_len_penalty, get_sampling_token_fn
  from nemo.collections.nlp.parts.utils_funcs import get_last_rank
  from nemo.utils import AppState, logging
label_desc: Use image node_id 4 for calling the MegatronLMEncoderDecoderModel obj's underlying member method code with example usage: obj._handle_bias_activation_fusion_args(cfg) without return types