code: def get_name_map(tf_names, is_TF1=True):
      """
      Get the converting mapping between TF 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 special variable_scope (tensorflow) and prefix (mxnet).
  
      Redefined mapping is encouraged to adapt the personalization model.
  
      Parameters
      ----------
      tf_names
          the parameters names of tensorflow model
      is_TF1
          whether load from TF1 Hub Modules
  
      Returns
      -------
      A dictionary with the following format:
          {tf_names : mx_names} or {tf_names : th_names}
      """
      convert_map = CONVERT_MAP_TF1 if is_TF1 else CONVERT_MAP_TF2
      if args.torch and is_TF1:
          CONVERT_MAP_TF1.insert(
              10,
              (
                  "embeddings/position_embeddings",
                  "token_pos_embed.weight",
              ),
          )
          CONVERT_MAP_TF1.insert(-1, ("beta", "bias"))
          CONVERT_MAP_TF1.insert(-1, ("gamma", "weight"))
      elif is_TF1:
          CONVERT_MAP_TF1.insert(
              10,
              (
                  "embeddings/position_embeddings",
                  "token_pos_embed._embed.weight",
              ),
          )
      elif args.torch:
          CONVERT_MAP_TF2.insert(
              10,
              (
                  "position_embedding/embeddings",
                  "token_pos_embed.weight",
              ),
          )
      else:
          CONVERT_MAP_TF2.insert(
              10,
              (
                  "position_embedding/embeddings",
                  "token_pos_embed._embed.weight",
              ),
          )
  
      name_map = {}
      for source_name in tf_names:
          target_name = source_name
          # skip the qkv weights
          if "self/" in source_name:
              name_map[source_name] = None
              continue
          if (
              re.match(
                  r"^transformer\/layer_[\d]+\/self_attention\/(key|value|query)\/(kernel|bias)$",
                  source_name,
              )
              is not None
          ):
              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 tensorflow_hub
  import tensorflow.compat.v1
  import os
  import re
  import json
  import shutil
  import logging
  import argparse
  import mxnet
  import torch
  import numpy
  from numpy.testing import assert_allclose
  from gluonnlp.data.vocab import Vocab
  from gluonnlp.utils.misc import naming_convention, logging_config, BooleanOptionalAction
  from gluonnlp.models.bert import BertModel, BertForMLM
  from gluonnlp.models.albert import AlbertModel, AlbertForMLM
  from gluonnlp.torch.models.bert import BertModel, BertForMLM
  from gluonnlp.data.tokenizers import SentencepieceTokenizer, HuggingFaceWordPieceTokenizer
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: get_name_map(tf_names, is_TF1) and returns: name_map