Adds a copy of Graph with the specified set of tags.
(self, graph, tags=None)
| 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]) |