code: def _optimistic_restore(self, session, save_file):
      reader = tf.train.NewCheckpointReader(save_file)
      saved_shapes = reader.get_variable_to_shape_map()
  
      restore_vars = []
      for var in tf.global_variables():
          var_name = var.name.split(":")[0]
          if var_name in saved_shapes and len(var.shape) > 0:
              if var.get_shape().as_list() == saved_shapes[var_name]:
                  restore_vars.append(var)
  
      saver = tf.train.Saver(restore_vars)
      saver.restore(session, save_file)
  
imports: import tensorflow
  import numpy
  import os
label_desc: Use image node_id 10 for calling the Recommender obj's underlying member method code with example usage: obj._optimistic_restore(session, save_file) without return types