code: def get_name_map(tf_names, convert_type="backbone"):
      """
      Get the converting mapping between tensor names and mxnet names.
      The above mapping CONVERT_MAP is effectively adaptive to Bert and Albert,
      but there is no guarantee that it can match to other tf models in case of
      some sepecial variable_scope (tensorflow) and prefix (mxnet).
  
      Redefined mapping is encouraged to adapt the personalization model.
  
      Parameters
      ----------
      tf_names
          the parameters names of tensorflow model
      convert_type
          choices=['backbone', 'disc', 'gen']
      Returns
      -------
      A dictionary with the following format:
          {tf_names : mx_names}
      """
      name_map = {}
      for source_name in tf_names:
          target_name = source_name
          if convert_type == "backbone":
              if "electra" not in source_name:
                  continue
          elif convert_type == "disc":
              target_name = "backbone_model." + target_name
              if "generator" in source_name:
                  continue
          elif convert_type == "gen":
              target_name = "backbone_model." + target_name
              if "generator" not in source_name:
                  continue
          else:
              raise NotImplementedError
          # skip the qkv weights
          if "self/" in source_name:
              name_map[source_name] = None
              continue
          for old, new in CONVERT_MAP:
              target_name = target_name.replace(old, new)
          name_map[source_name] = target_name
      return name_map
  
imports: import os
  import re
  import sys
  import shutil
  import logging
  import argparse
  import mxnet
  import numpy
  from numpy.testing import assert_allclose
  from gluonnlp.utils.misc import naming_convention, logging_config
  from gluonnlp.data.tokenizers import HuggingFaceWordPieceTokenizer
  from gluonnlp.models.electra import ElectraModel, ElectraGenerator, ElectraDiscriminator, ElectraForPretrain, get_generator_cfg
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: get_name_map(tf_names, convert_type) and returns: name_map