MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CheckDocsMatch

Function CheckDocsMatch

tensorflow/core/api_def/update_api_def.cc:96–121  ·  view source on GitHub ↗

Returns true if summary and all descriptions are the same in op1 and op2.

Source from the content-addressed store, hash-verified

94// Returns true if summary and all descriptions are the same in op1
95// and op2.
96bool CheckDocsMatch(const OpDef& op1, const OpDef& op2) {
97 if (op1.summary() != op2.summary() ||
98 op1.description() != op2.description() ||
99 op1.input_arg_size() != op2.input_arg_size() ||
100 op1.output_arg_size() != op2.output_arg_size() ||
101 op1.attr_size() != op2.attr_size()) {
102 return false;
103 }
104 // Iterate over args and attrs to compare their docs.
105 for (int i = 0; i < op1.input_arg_size(); ++i) {
106 if (op1.input_arg(i).description() != op2.input_arg(i).description()) {
107 return false;
108 }
109 }
110 for (int i = 0; i < op1.output_arg_size(); ++i) {
111 if (op1.output_arg(i).description() != op2.output_arg(i).description()) {
112 return false;
113 }
114 }
115 for (int i = 0; i < op1.attr_size(); ++i) {
116 if (op1.attr(i).description() != op2.attr(i).description()) {
117 return false;
118 }
119 }
120 return true;
121}
122
123// Returns true if descriptions and summaries in op match a
124// given single doc-string.

Callers 1

ValidateOpDocsFunction · 0.85

Calls 3

descriptionMethod · 0.80
attrMethod · 0.80
summaryMethod · 0.45

Tested by

no test coverage detected