class_docstr: Load graphs and restore variable values from a `SavedModel`.
docstr: Restore SavedModel variable values into the session.
  
  Args:
    sess: tf.compat.v1.Session to restore variable values.
    saver: a tf.compat.v1.train.Saver object. Can be None if there are no
      variables in graph. This may be the saver returned by the load_graph()
      function, or a default `tf.compat.v1.train.Saver()`.
    import_scope: Optional `string` -- if specified, prepend this string
      followed by '/' to all loaded tensor names. This scope is applied to
      tensor instances loaded into the passed session, but it is *not* written
      through to the static `MetaGraphDef` protocol buffer that is returned.
  
  Raises:
    ValueError: if no saver was passed to the saver argument, and there are
      variables in the graph.
docstr_tok: ["Restore","SavedModel","variable","values","into","the","session",".","Args",":","sess",":","tf.compat.v1.Session","to","restore","variable","values",".","saver",":","a","tf.compat.v1.train.Saver","object",".","Can","be","None","if","there","are","no","variables","in","graph",".","This","may","be","the","saver","returned","by","the","load_graph","(",")","function",",","or","a","default","`","tf.compat.v1.train.Saver","(",")","`",".","import_scope",":","Optional","`","string","`","--","if","specified",",","prepend","this","string","followed","by","'\/","'","to","all","loaded","tensor","names",".","This","scope","is","applied","to","tensor","instances","loaded","into","the","passed","session",",","but","it","is","*","not","*","written","through","to","the","static","`","MetaGraphDef","`","protocol","buffer","that","is","returned",".","Raises",":","ValueError",":","if","no","saver","was","passed","to","the","saver","argument",",","and","there","are","variables","in","the","graph","."]
code: def restore_variables(self, sess, saver, import_scope=None):
      """Restore SavedModel variable values into the session.
  
      Args:
        sess: tf.compat.v1.Session to restore variable values.
        saver: a tf.compat.v1.train.Saver object. Can be None if there are no
          variables in graph. This may be the saver returned by the load_graph()
          function, or a default `tf.compat.v1.train.Saver()`.
        import_scope: Optional `string` -- if specified, prepend this string
          followed by '/' to all loaded tensor names. This scope is applied to
          tensor instances loaded into the passed session, but it is *not* written
          through to the static `MetaGraphDef` protocol buffer that is returned.
  
      Raises:
        ValueError: if no saver was passed to the saver argument, and there are
          variables in the graph.
      """
      with sess.graph.as_default():
          if saver is None and not variables._all_saveable_objects(
              scope=import_scope
          ):  # pylint: disable=protected-access
              tf_logging.info(
                  "The specified SavedModel has no variables; no "
                  "checkpoints were restored."
              )
          elif isinstance(saver, tf_saver.Saver):
              saver.restore(sess, self._variables_path)
          else:
              raise ValueError(
                  "No tf.train.Saver object was passed to the function "
                  "`SavedModelLoader.restore_variables`. Since there are variables in"
                  " the graph, a saver is required."
              )
  
imports: import os
  import sys
  from google.protobuf import message
  from google.protobuf import text_format
  from tensorflow.core.framework import graph_debug_info_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saved_model_pb2
  from tensorflow.python.framework import ops
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model import constants
  from tensorflow.python.saved_model import path_helpers
  from tensorflow.python.saved_model import signature_def_utils
  from tensorflow.python.saved_model import utils_impl
  from tensorflow.python.saved_model.pywrap_saved_model import metrics
  from tensorflow.python.training import saver
  from tensorflow.python.util import compat
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 7 for calling the SavedModelLoader obj's underlying member method code with example usage: obj.restore_variables(sess, saver, import_scope) without return types