code: def load_variable(checkpoint_path, var_name, shape, dtype):
      """Loads a variable from a given checkpoint."""
      with tf.Graph().as_default():
          variable = v1.get_variable(
              var_name,
              shape=shape,
              dtype=dtype,
              initializer=v1.zeros_initializer(),
              trainable=False,
          )
          trackable_vars = {var_name: variable}
          checkpoint = v2.train.Checkpoint(**trackable_vars)
          status = checkpoint.restore(checkpoint_path)
          status.expect_partial()
          with v1.Session() as session:
              status.initialize_or_restore(session)
              return session.run(variable)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from distutils.version import LooseVersion
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow.python import tf2
  from tensorflow.python.keras.metrics import Metric
  from tensorflow.python.tpu import tpu_function
  from tensorflow_estimator.python.estimator.head import regression_head
label_desc: Use image node_id 11 for calling a global function with example usage: load_variable(checkpoint_path, var_name, shape, dtype) and returns: session