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

Function MakeComment

tensorflow/cc/framework/cc_op_gen.cc:117–135  ·  view source on GitHub ↗

Change: Into: ABC /// ABC /// DEF /// DEF

Source from the content-addressed store, hash-verified

115// ///
116// DEF /// DEF
117string MakeComment(StringPiece text, StringPiece indent) {
118 string ret;
119 while (!text.empty()) {
120 int last_non_space = -1;
121 int newline;
122 for (newline = 0; newline < static_cast<int>(text.size()); ++newline) {
123 if (text[newline] == '\n') break;
124 if (text[newline] != ' ') last_non_space = newline;
125 }
126 if (last_non_space == -1) {
127 strings::StrAppend(&ret, indent, "///\n");
128 } else {
129 strings::StrAppend(&ret, indent, "/// ",
130 text.substr(0, last_non_space + 1), "\n");
131 }
132 text.remove_prefix(newline + 1);
133 }
134 return ret;
135}
136
137string PrintString(const string& str) {
138 return strings::StrCat("\"", absl::CEscape(str), "\"");

Callers 2

OpInfoMethod · 0.85
GetOpAttrStructMethod · 0.85

Calls 3

StrAppendFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected