def __init__(self, sess, vars_to_update, ignore_mismatch=False):
        """
        Args:
            sess (tf.Session): a session object
            vars_to_update: a collection of variables to update
            ignore_mismatch (bool): ignore failures when the value and the
                variable does not match.
        """
        self.sess = sess
        self.name_map = {v.name: v for v in vars_to_update}
        self.ignore_mismatch = ignore_mismatch

        Args:
            sess (tf.Session): a session object
            vars_to_update: a collection of variables to update
            ignore_mismatch (bool): ignore failures when the value and the
                variable does not match.
        
tensorpack/tfutils/varmanip.py