MCPcopy Index your code
hub / github.com/tensorflow/hub / add_graph_copy

Method add_graph_copy

tensorflow_hub/saved_model_lib.py:361–372  ·  view source on GitHub ↗

Adds a copy of Graph with the specified set of tags.

(self, graph, tags=None)

Source from the content-addressed store, hash-verified

359 self._proto = saved_model_pb2.SavedModel()
360
361 def add_graph_copy(self, graph, tags=None):
362 """Adds a copy of Graph with the specified set of tags."""
363 with graph.as_default():
364 # Remove default attrs so that Modules created by a tensorflow version
365 # with ops that have new attrs that are left to their default values can
366 # still be loaded by older versions unware of those attributes.
367 meta_graph = tf.compat.v1.train.export_meta_graph(
368 strip_default_attrs=True)
369 _export_tags(meta_graph, tags)
370 _export_signatures(meta_graph)
371 _export_module_attachments(meta_graph)
372 self._proto.meta_graphs.extend([meta_graph])
373
374 def add_meta_graph_copy(self, meta_graph):
375 self._proto.meta_graphs.extend([meta_graph])

Calls 3

_export_tagsFunction · 0.85
_export_signaturesFunction · 0.85