code: def get_assignment_map_from_checkpoint(tvars, init_checkpoint):
      """Compute the union of the current variables and checkpoint variables."""
      assignment_map = {}
      initialized_variable_names = {}
  
      name_to_variable = collections.OrderedDict()
      for var in tvars:
          name = var.name
          m = re.match("^(.*):\\d+$", name)
          if m is not None:
              name = m.group(1)
          name_to_variable[name] = var
  
      init_vars = tf.train.list_variables(init_checkpoint)
  
      assignment_map = collections.OrderedDict()
      for x in init_vars:
          (name, var) = (x[0], x[1])
          if name not in name_to_variable:
              continue
          assignment_map[name] = name
          initialized_variable_names[name] = 1
          initialized_variable_names[name + ":0"] = 1
  
      return (assignment_map, initialized_variable_names)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import copy
  import json
  import math
  import re
  import numpy
  import six
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: get_assignment_map_from_checkpoint(tvars, init_checkpoint) and returns: assignment_map,  initialized_variable_names