code: def get_scaffold_init_fn(self):
      def init_fn(scaffold, session):
          var_loader = BatchedVarLoad()
          self.var_val = []
  
          if self.variables is not None:
              variables_sv = self.variables
          else:
              variables_sv = dict()
          all_vars = tf.compat.v1.global_variables()
  
          global_step_var = tf.compat.v1.train.get_global_step()
  
          for var in all_vars:
              if (
                  self.restart_global_step
                  and global_step_var is not None
                  and global_step_var.name == var.name
              ):
                  continue
              name = var.name
              saved_var = None
              if name in variables_sv.keys():
                  saved_var = variables_sv[name]
              elif name in self.fallback.keys():
                  saved_var = self.fallback[name]
  
              if saved_var is not None:
                  if (
                      self.add_tokens
                      and name
                      == "model/featurizer/shared/shared/weight:0"
                  ):
                      if var.shape[0] != saved_var.shape[0]:
                          num_rows = var.shape[0] - saved_var.shape[0]
                          new_rows = np.random.normal(
                              size=(num_rows, saved_var.shape[1]),
                              scale=0.01,
                          )
                          saved_var = np.concatenate(
                              (saved_var, new_rows), axis=0
                          )
                  for func in self.variable_transforms:
                      saved_var = func(name, saved_var)
                  var_loader.add(var, saved_var)
              else:
                  if name.startswith("model/featurizer"):
                      permitted = (
                          self.permit_uninitialized is not None
                          and re.findall(
                              self.permit_uninitialized, name
                          )
                      )
                      if not permitted:
                          raise ValueError(
                              "Uninitialized featurizer variable {}".format(
                                  name
                              )
                          )
  
          var_loader.run(session)
  
      return init_fn
  
imports: import os
  from concurrent.futures import ThreadPoolExecutor
  import logging
  import sys
  import re
  import joblib
  import numpy
  import tensorflow
  from tensorflow.compat.v1.train import SessionRunHook
  from tensorflow_estimator.python.estimator.early_stopping import _StopOnPredicateHook
  from finetune.errors import FinetuneError
  from finetune.config import get_config
  from finetune.util.metrics import read_eval_metrics
label_desc: Use image node_id 8 for calling the Saver obj's underlying member method code with example usage: obj.get_scaffold_init_fn() and returns: init_fn