class_docstr: Restore a tensorflow checkpoint saved by :class:`tf.train.Saver` or :class:`ModelSaver`.
class_docstr_tok: ["Restore","a","tensorflow","checkpoint","saved","by",":","class",":","`","tf.train.Saver","`","or",":","class",":","`","ModelSaver","`","."]
code: def _match_vars(self, func):
      reader, chkpt_vars = SaverRestore._read_checkpoint_vars(self.path)
      graph_vars = tf.global_variables()
      chkpt_vars_used = set()
  
      mismatch = MismatchLogger("graph", "checkpoint")
      for v in graph_vars:
          name = get_savename_from_varname(
              v.name, varname_prefix=self.prefix
          )
          if name in self.ignore and reader.has_tensor(name):
              logger.info(
                  "Variable {} in the graph will not be loaded from the checkpoint!".format(
                      name
                  )
              )
          else:
              if reader.has_tensor(name):
                  func(reader, name, v)
                  chkpt_vars_used.add(name)
              else:
                  # use tensor name (instead of op name) for logging, to be consistent with the reverse case
                  if not is_training_name(v.name):
                      mismatch.add(v.name)
      mismatch.log()
      mismatch = MismatchLogger("checkpoint", "graph")
      if len(chkpt_vars_used) < len(chkpt_vars):
          unused = chkpt_vars - chkpt_vars_used
          for name in sorted(unused):
              if not is_training_name(name):
                  mismatch.add(name)
      mismatch.log()
  
imports: import os
  import numpy
  import six
  from ..compat import tfv1
  from ..utils import logger
  from .common import get_op_tensor_name
  from .varmanip import SessionUpdate, get_checkpoint_path, get_savename_from_varname, is_training_name
label_desc: Use image node_id 5 for calling the SaverRestore obj's underlying member method code with example usage: obj._match_vars(func) without return types