diff --git a/tensorflow/core/framework/graph_def_util.cc b/tensorflow/core/framework/graph_def_util.cc index d731003366a..b76ab40b683 100644 --- a/tensorflow/core/framework/graph_def_util.cc +++ b/tensorflow/core/framework/graph_def_util.cc @@ -39,14 +39,6 @@ string SummarizeGraphDef(const GraphDef& graph_def) { return ret; } -string SummarizeGraphDef(gtl::ArraySlice<NodeDef> node_defs) { - string ret; - for (const NodeDef& node : node_defs) { - strings::StrAppend(&ret, SummarizeNodeDef(node), ";\n"); - } - return ret; -} - Status ValidateExternalGraphDefSyntax(const GraphDef& graph_def) { for (const NodeDef& node : graph_def.node()) { TF_RETURN_IF_ERROR(ValidateExternalNodeDefSyntax(node)); diff --git a/tensorflow/core/framework/graph_def_util.h b/tensorflow/core/framework/graph_def_util.h index 27e3de581ad..56355eaf367 100644 --- a/tensorflow/core/framework/graph_def_util.h +++ b/tensorflow/core/framework/graph_def_util.h @@ -27,7 +27,6 @@ namespace tensorflow { // Produce a human-readable version of a GraphDef that is more concise // than a text-format proto. string SummarizeGraphDef(const GraphDef& graph_def); -string SummarizeGraphDef(gtl::ArraySlice<NodeDef> node_defs); // Validates the syntax of a GraphDef provided externally. // diff --git a/tensorflow/core/util/equal_graph_def.cc b/tensorflow/core/util/equal_graph_def.cc index 8ad91e5adb2..2db026da56c 100644 --- a/tensorflow/core/util/equal_graph_def.cc +++ b/tensorflow/core/util/equal_graph_def.cc @@ -24,10 +24,16 @@ limitations under the License. namespace tensorflow { -template <class NodeDefs> -static bool EqualNodeDefsHelper( - const NodeDefs& actual, const protobuf::RepeatedPtrField<NodeDef>& expected, - string* diff, const EqualGraphDefOptions& options) { +bool EqualGraphDef(const GraphDef& actual, const GraphDef& expected, + string* diff, const EqualGraphDefOptions& options) { + // Intentionally do not check that versions match so that this routine can + // be used for less brittle golden file tests. + return EqualRepeatedNodeDef(actual.node(), expected.node(), diff, options); +} + +bool EqualRepeatedNodeDef(const protobuf::RepeatedPtrField<NodeDef>& actual, + const protobuf::RepeatedPtrField<NodeDef>& expected, + string* diff, const EqualGraphDefOptions& options) { std::unordered_map<string, const NodeDef*> actual_index; for (const NodeDef& node : actual) { actual_index[node.name()] = &node; @@ -62,24 +68,6 @@ static bool EqualNodeDefsHelper( return true; } -bool EqualGraphDef(const GraphDef& actual, const GraphDef& expected, - string* diff, const EqualGraphDefOptions& options) { - // Intentionally do not check that versions match so that this routine can - // be used for less brittle golden file tests. - return EqualNodeDefsHelper(actual.node(), expected.node(), diff, options); -} - -bool EqualGraphDef(gtl::ArraySlice<NodeDef> actual, const GraphDef& expected, - string* diff, const EqualGraphDefOptions& options) { - return EqualNodeDefsHelper(actual, expected.node(), diff, options); -} - -bool EqualRepeatedNodeDef(const protobuf::RepeatedPtrField<NodeDef>& actual, - const protobuf::RepeatedPtrField<NodeDef>& expected, - string* diff, const EqualGraphDefOptions& options) { - return EqualNodeDefsHelper(actual, expected, diff, options); -} - namespace { string JoinStringField(const protobuf::RepeatedPtrField<string>& f) { diff --git a/tensorflow/core/util/equal_graph_def.h b/tensorflow/core/util/equal_graph_def.h index 29d0385493f..1ce6181c2e7 100644 --- a/tensorflow/core/util/equal_graph_def.h +++ b/tensorflow/core/util/equal_graph_def.h @@ -36,8 +36,6 @@ struct EqualGraphDefOptions { // nodes must be consistent. bool EqualGraphDef(const GraphDef& actual, const GraphDef& expected, string* diff, const EqualGraphDefOptions& options = {}); -bool EqualGraphDef(gtl::ArraySlice<NodeDef> actual, const GraphDef& expected, - string* diff, const EqualGraphDefOptions& options = {}); // Determines if actual and expected are equal, ignoring: ordering of // attrs, internal attributes (if set in `options`), and control inputs.