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

Function FindMultiline

tensorflow/core/framework/op_gen_lib.cc:186–196  ·  view source on GitHub ↗

Given a single line of text `line` with first : at `colon`, determine if there is an "<<END" expression after the colon and if so return true and set `*end` to everything after the "<<".

Source from the content-addressed store, hash-verified

184// there is an "<<END" expression after the colon and if so return true and set
185// `*end` to everything after the "<<".
186static bool FindMultiline(StringPiece line, size_t colon, string* end) {
187 if (colon == StringPiece::npos) return false;
188 line.remove_prefix(colon + 1);
189 while (absl::ConsumePrefix(&line, " ")) {
190 }
191 if (absl::ConsumePrefix(&line, "<<")) {
192 *end = string(line);
193 return true;
194 }
195 return false;
196}
197
198string PBTxtFromMultiline(StringPiece multiline_pbtxt) {
199 string pbtxt;

Callers 1

PBTxtFromMultilineFunction · 0.85

Calls 1

ConsumePrefixFunction · 0.50

Tested by

no test coverage detected