class_docstr: Restore variables from a dictionary.
class_docstr_tok: ["Restore","variables","from","a","dictionary","."]
docstr: Args:
      variable_dict (dict): a dict of {name: value}
      ignore_mismatch (bool): ignore failures when the value and the
          variable does not match in their shapes.
          If False, it will throw exception on such errors.
          If True, it will only print a warning.
docstr_tok: ["Args",":","variable_dict","(","dict",")",":","a","dict","of","{","name",":","value","}","ignore_mismatch","(","bool",")",":","ignore","failures","when","the","value","and","the","variable","does","not","match","in","their","shapes",".","If","False",",","it","will","throw","exception","on","such","errors",".","If","True",",","it","will","only","print","a","warning","."]
code: def __init__(self, variable_dict, ignore_mismatch=False):
      """
      Args:
          variable_dict (dict): a dict of {name: value}
          ignore_mismatch (bool): ignore failures when the value and the
              variable does not match in their shapes.
              If False, it will throw exception on such errors.
              If True, it will only print a warning.
      """
      assert isinstance(variable_dict, dict), type(variable_dict)
      # use varname (with :0) for consistency
      self._prms = {
          get_op_tensor_name(n)[1]: v
          for n, v in six.iteritems(variable_dict)
      }
      self._ignore_mismatch = ignore_mismatch
  
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 1 to create a new DictRestore object from inherited base classes: SessionInit with example: obj = DictRestore(variable_dict, ignore_mismatch)