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

Function ValidateOpDocs

tensorflow/core/api_def/update_api_def.cc:125–144  ·  view source on GitHub ↗

Returns true if descriptions and summaries in op match a given single doc-string.

Source from the content-addressed store, hash-verified

123// Returns true if descriptions and summaries in op match a
124// given single doc-string.
125bool ValidateOpDocs(const OpDef& op, const string& doc) {
126 OpDefBuilder b(op.name());
127 // We don't really care about type we use for arguments and
128 // attributes. We just want to make sure attribute and argument names
129 // are added so that descriptions can be assigned to them when parsing
130 // documentation.
131 for (const auto& arg : op.input_arg()) {
132 b.Input(arg.name() + ":string");
133 }
134 for (const auto& arg : op.output_arg()) {
135 b.Output(arg.name() + ":string");
136 }
137 for (const auto& attr : op.attr()) {
138 b.Attr(attr.name() + ":string");
139 }
140 b.Doc(doc);
141 OpRegistrationData op_reg_data;
142 TF_CHECK_OK(b.Finalize(&op_reg_data));
143 return CheckDocsMatch(op, op_reg_data.op_def);
144}
145} // namespace
146
147string RemoveDoc(const OpDef& op, const string& file_contents,

Callers 1

RemoveDocFunction · 0.85

Calls 7

CheckDocsMatchFunction · 0.85
attrMethod · 0.80
nameMethod · 0.65
InputMethod · 0.45
OutputMethod · 0.45
AttrMethod · 0.45
FinalizeMethod · 0.45

Tested by

no test coverage detected