From da1588ccf5c62eccac8013673359ac15b43eb394 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 2 Jan 2018 18:19:21 -0800 Subject: meta_graph export: Add support to strip default valued attributes. Following APIs now accept an additional argument (`strip_default_attrs`) to enable/disable (default:disabled) stripping of default valued attributes in a NodeDef: o meta_graph: export_meta_graph, create_meta_graph. o saver: Saver.save, Saver.export_meta_graph. o builder: SavedModelBuilder.add_meta_graph, SavedModelBuilder.add_meta_graph_and_variables. o estimator: Estimator.export_savedmodel. Related changes: o Pywrap C++ AreAttrValuesEqual to compare two AttrValue instances. This allows for a single/canonical way of comparing AttrValues in C++/Python. o Add a utility method to meta_graph.py to get the node def by name in a graph def. o Update SavedModelBuilder documentation on relevance of strip_default_attrs flag. PiperOrigin-RevId: 180619001 --- tensorflow/core/protobuf/meta_graph.proto | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tensorflow/core/protobuf/meta_graph.proto') diff --git a/tensorflow/core/protobuf/meta_graph.proto b/tensorflow/core/protobuf/meta_graph.proto index 47ec2aa1ef..fd86c0da12 100644 --- a/tensorflow/core/protobuf/meta_graph.proto +++ b/tensorflow/core/protobuf/meta_graph.proto @@ -61,6 +61,10 @@ message MetaGraphDef { // graph. This will be populated by the framework, which will overwrite any // user supplied value. string tensorflow_git_version = 6; + + // A flag to denote whether default-valued attrs have been stripped from + // the nodes in this graph_def. + bool stripped_default_attrs = 7; } MetaInfoDef meta_info_def = 1; -- cgit v1.2.3