code: def get_generator_cfg(model_config):
      """
      Get the generator configuration from the Electra model config.
      The size of generator is usually smaller than discriminator but same in electra small,
      which exists  a conflict between source code and original paper.
      """
      generator_cfg = model_config.clone()
      generator_layers_scale = model_config.MODEL.generator_layers_scale
      generator_units_scale = model_config.MODEL.generator_units_scale
      generator_cfg.defrost()
      # the round function is used to slove int(0.3333*768)!=256 for electra base
      generator_cfg.MODEL.units = round(
          generator_units_scale * model_config.MODEL.units
      )
      generator_cfg.MODEL.hidden_size = round(
          generator_units_scale * model_config.MODEL.hidden_size
      )
      generator_cfg.MODEL.num_heads = round(
          generator_units_scale * model_config.MODEL.num_heads
      )
      generator_cfg.MODEL.num_layers = round(
          generator_layers_scale * model_config.MODEL.num_layers
      )
      generator_cfg.freeze()
      return generator_cfg
  
imports: import os
  from typing import Tuple, Optional, List
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import HybridBlock, nn
  from .base import BACKBONE_REGISTRY
  from .transformer import TransformerEncoderLayer
  from ..op import gumbel_softmax, select_vectors_by_position, add_vectors_by_position, update_vectors_by_position
  from ..base import get_model_zoo_home_dir, get_repo_model_zoo_url, get_model_zoo_checksum_dir
  from ..layers import PositionalEmbedding, get_activation
  from ..initializer import TruncNorm
  from ..utils.config import CfgNode
  from ..utils.misc import load_checksum_stats, download
  from ..utils.registry import Registry
  from ..attention_cell import gen_self_attn_mask
  from ..data.tokenizers import HuggingFaceWordPieceTokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: get_generator_cfg(model_config) and returns: generator_cfg