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

Function RenameInDocs

tensorflow/core/framework/op_gen_lib.cc:273–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273static void RenameInDocs(const string& from, const string& to,
274 ApiDef* api_def) {
275 const string from_quoted = strings::StrCat("`", from, "`");
276 const string to_quoted = strings::StrCat("`", to, "`");
277 for (int i = 0; i < api_def->in_arg_size(); ++i) {
278 if (!api_def->in_arg(i).description().empty()) {
279 StringReplace(from_quoted, to_quoted,
280 api_def->mutable_in_arg(i)->mutable_description());
281 }
282 }
283 for (int i = 0; i < api_def->out_arg_size(); ++i) {
284 if (!api_def->out_arg(i).description().empty()) {
285 StringReplace(from_quoted, to_quoted,
286 api_def->mutable_out_arg(i)->mutable_description());
287 }
288 }
289 for (int i = 0; i < api_def->attr_size(); ++i) {
290 if (!api_def->attr(i).description().empty()) {
291 StringReplace(from_quoted, to_quoted,
292 api_def->mutable_attr(i)->mutable_description());
293 }
294 }
295 if (!api_def->summary().empty()) {
296 StringReplace(from_quoted, to_quoted, api_def->mutable_summary());
297 }
298 if (!api_def->description().empty()) {
299 StringReplace(from_quoted, to_quoted, api_def->mutable_description());
300 }
301}
302
303namespace {
304

Callers 1

UpdateDocsMethod · 0.85

Calls 6

descriptionMethod · 0.80
attrMethod · 0.80
StringReplaceFunction · 0.70
StrCatFunction · 0.50
emptyMethod · 0.45
summaryMethod · 0.45

Tested by

no test coverage detected