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

Function LogLines

tensorflow/compiler/xla/util.cc:229–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void LogLines(int sev, absl::string_view text, const char* fname, int lineno) {
230 const int orig_sev = sev;
231 if (sev == tensorflow::FATAL) {
232 sev = tensorflow::ERROR;
233 }
234
235 // Protect calls with a mutex so we don't interleave calls to LogLines from
236 // multiple threads.
237 static tensorflow::mutex log_lines_mu(tensorflow::LINKER_INITIALIZED);
238 tensorflow::mutex_lock lock(log_lines_mu);
239
240 size_t cur = 0;
241 while (cur < text.size()) {
242 size_t eol = text.find('\n', cur);
243 if (eol == absl::string_view::npos) {
244 eol = text.size();
245 }
246 auto msg = text.substr(cur, eol - cur);
247 tensorflow::internal::LogString(fname, lineno, sev,
248 string(msg.data(), msg.size()));
249 cur = eol + 1;
250 }
251
252 if (orig_sev == tensorflow::FATAL) {
253 tensorflow::internal::LogString(fname, lineno, orig_sev,
254 "Aborting due to errors.");
255 }
256}
257
258int64 Product(absl::Span<const int64> xs) {
259 return std::accumulate(xs.begin(), xs.end(), static_cast<int64>(1),

Callers 1

TESTFunction · 0.85

Calls 4

LogStringFunction · 0.50
sizeMethod · 0.45
findMethod · 0.45
dataMethod · 0.45

Tested by 1

TESTFunction · 0.68