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

Function PBTxtToMultiline

tensorflow/core/framework/op_gen_lib.cc:165–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165string PBTxtToMultiline(StringPiece pbtxt,
166 const std::vector<string>& multi_line_fields) {
167 string ml;
168 // Probably big enough, since the input and output are about the
169 // same size, but just a guess.
170 ml.reserve(pbtxt.size() * (17. / 16));
171 StringPiece line;
172 while (!pbtxt.empty()) {
173 // Split pbtxt into its first line and everything after.
174 SplitAt('\n', &pbtxt, &line);
175 // Convert line or output it unchanged
176 if (!ConvertLine(line, multi_line_fields, &ml)) {
177 strings::StrAppend(&ml, line, "\n");
178 }
179 }
180 return ml;
181}
182
183// Given a single line of text `line` with first : at `colon`, determine if
184// there is an "<<END" expression after the colon and if so return true and set

Callers 3

RunFunction · 0.85
TESTFunction · 0.85
CreateApiDefFunction · 0.85

Calls 6

SplitAtFunction · 0.85
ConvertLineFunction · 0.85
StrAppendFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.68