class_docstr: Load graphs and restore variable values from a `SavedModel`.
docstr: Load the MetaGraphDef graph and restore variable values into the session.
  
  Args:
    sess: tf.compat.v1.Session to restore variable values.
    tags: a set of string tags identifying a MetaGraphDef.
    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.
    **saver_kwargs: keyword arguments to pass to tf.train.import_meta_graph.
  
  Returns:
    `MetagraphDef` proto of the graph that was loaded.
docstr_tok: ["Load","the","MetaGraphDef","graph","and","restore","variable","values","into","the","session",".","Args",":","sess",":","tf.compat.v1.Session","to","restore","variable","values",".","tags",":","a","set","of","string","tags","identifying","a","MetaGraphDef",".","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",".","*","*","saver_kwargs",":","keyword","arguments","to","pass","to","tf.train.import_meta_graph",".","Returns",":","`","MetagraphDef","`","proto","of","the","graph","that","was","loaded","."]
code: def load(self, sess, tags, import_scope=None, **saver_kwargs):
      """Load the MetaGraphDef graph and restore variable values into the session.
  
      Args:
        sess: tf.compat.v1.Session to restore variable values.
        tags: a set of string tags identifying a MetaGraphDef.
        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.
        **saver_kwargs: keyword arguments to pass to tf.train.import_meta_graph.
  
      Returns:
        `MetagraphDef` proto of the graph that was loaded.
      """
      saved_model_proto = parse_saved_model(self._export_dir)
      metrics.IncrementReadApi(_LOADER_LABEL)
  
      with sess.graph.as_default():
          saver, _ = self.load_graph(
              sess.graph, tags, import_scope, **saver_kwargs
          )
          self.restore_variables(sess, saver, import_scope)
          self.run_init_ops(sess, tags, import_scope)
      meta_graph_def = self.get_meta_graph_def_from_tags(tags)
  
      if len(
          saved_model_proto.meta_graphs
      ) == 1 and saved_model_proto.meta_graphs[0].HasField(
          "object_graph_def"
      ):
          metrics.IncrementRead(write_version="2")
      else:
          metrics.IncrementRead(write_version="1")
  
      return meta_graph_def
  
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 9 for calling the SavedModelLoader obj's underlying member method code with example usage: obj.load(sess, tags, import_scope) and returns: meta_graph_def