code: def _map_tensor_names(original_tensor_name):
      """
      Tensor name mapping
      """
      global_tensor_map = {
          "model/wte": "word_embedder/w",
          "model/wpe": "position_embedder/w",
          "model/ln_f/b": "transformer_decoder/beta",
          "model/ln_f/g": "transformer_decoder/gamma",
      }
      if original_tensor_name in global_tensor_map:
          return global_tensor_map[original_tensor_name]
      original_tensor_name_split = original_tensor_name.split("/")
      layer_tensor_map = {
          "ln_1/b": "beta",
          "ln_1/g": "gamma",
          "ln_2/b": "past_poswise_ln/beta",
          "ln_2/g": "past_poswise_ln/gamma",
          "mlp/c_fc/b": "ffn/conv1/bias",
          "mlp/c_fc/w": "ffn/conv1/kernel",
          "mlp/c_proj/b": "ffn/conv2/bias",
          "mlp/c_proj/w": "ffn/conv2/kernel",
          "attn/c_proj/b": "self_attention/multihead_attention/output/bias",
          "attn/c_proj/w": "self_attention/multihead_attention/output/kernel",
      }
      layer_num = int(original_tensor_name_split[1][1:])
      layer_feature = "/".join(original_tensor_name.split("/")[2:])
      # pylint: disable=no-else-return
      if layer_feature in layer_tensor_map:
          layer_feature_ = layer_tensor_map[layer_feature]
          tensor_name_ = "/".join(
              [
                  "transformer_decoder",
                  "layer_{}".format(layer_num),
                  layer_feature_,
              ]
          )
          return tensor_name_
      else:
          return original_tensor_name
  
file_path: texar/examples/gpt-2/utils/model_utils.py
imports: import sys
  import json
  import tensorflow
  import numpy
  from texar.tf import HParams
label_desc: Use image node_id 2 for calling a global function with example usage: _map_tensor_names(original_tensor_name) and returns: global_tensor_map, tensor_name_, original_tensor_name