code: def convert_backbone_params(tf_params, gluon_backbone_model):
      TF_GLUON_NAME_MAP = {
          "model/wte": "_embed.weight",
          "model/wpe": "_pos_embed._embed.weight",
          "model/h(\d+)/ln_1/b": "_layers.{}.atten.ln.beta",
          "model/h(\d+)/ln_1/g": "_layers.{}.atten.ln.gamma",
          "model/h(\d+)/ln_2/b": "_layers.{}.ffn.layer_norm.beta",
          "model/h(\d+)/ln_2/g": "_layers.{}.ffn.layer_norm.gamma",
          "model/h(\d+)/mlp/c_fc/w": "_layers.{}.ffn.ffn_1.weight",
          "model/h(\d+)/mlp/c_fc/b": "_layers.{}.ffn.ffn_1.bias",
          "model/h(\d+)/mlp/c_proj/w": "_layers.{}.ffn.ffn_2.weight",
          "model/h(\d+)/mlp/c_proj/b": "_layers.{}.ffn.ffn_2.bias",
          "model/h(\d+)/attn/c_attn/w": "_layers.{}.atten.qkv.weight",
          "model/h(\d+)/attn/c_attn/b": "_layers.{}.atten.qkv.bias",
          "model/h(\d+)/attn/c_proj/w": "_layers.{}.atten.out_proj.weight",
          "model/h(\d+)/attn/c_proj/b": "_layers.{}.atten.out_proj.bias",
          "model/ln_f/b": "_final_ln.beta",
          "model/ln_f/g": "_final_ln.gamma",
      }
  
      params = gluon_backbone_model.collect_params()
      loaded = {k: False for k in params}
      for name, param_value in tf_params.items():
          gluon_param_name = None
          for lhs, rhs in TF_GLUON_NAME_MAP.items():
              match = re.match(lhs, name)
              if match is not None:
                  if len(match.groups()) > 0:
                      gluon_param_name = rhs.format(match.groups()[0])
                      break
                  else:
                      gluon_param_name = rhs
          assert gluon_param_name is not None
          print("{} --> {}".format(name, gluon_param_name))
          if param_value.shape != params[gluon_param_name].shape:
              params[gluon_param_name].set_data(param_value[0].T)
          else:
              params[gluon_param_name].set_data(param_value)
          loaded[gluon_param_name] = True
      for name in params:
          if not loaded[name]:
              print("{} is not loaded!".format(name))
  
imports: import os
  import re
  import json
  import shutil
  import logging
  import argparse
  import tensorflow
  from tensorflow.contrib.training import HParams
  from gpt_2.src import model
  import mxnet
  import numpy
  from numpy.testing import assert_allclose
  from gluonnlp.data.vocab import Vocab
  from gluonnlp.utils.misc import sha1sum, logging_config, naming_convention
  from gluonnlp.models.gpt2 import GPT2Model, GPT2ForLM
label_desc: Use image node_id 5 for calling a global function with example usage: convert_backbone_params(tf_params, gluon_backbone_model) without return types