code: def init_gpt2_checkpoint(sess, init_checkpoint):
      """
      Initializes GPT-2 model parameters from a checkpoint
  
      Args:
          init_checkpoint (str): Path to the checkpoint.
      """
      tvars = tf.trainable_variables()
      if init_checkpoint:
          assignment_map = _get_assignment_map_from_checkpoint(
              sess, tvars, init_checkpoint
          )
          init_fn = tf.contrib.framework.assign_from_checkpoint_fn(
              init_checkpoint, assignment_map, reshape_variables=True
          )
          init_fn(sess)
  
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 4 for calling a global function with example usage: init_gpt2_checkpoint(sess, init_checkpoint) without return types