Returns true if summary and all descriptions are the same in op1 and op2.
| 94 | // Returns true if summary and all descriptions are the same in op1 |
| 95 | // and op2. |
| 96 | bool 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. |
no test coverage detected