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

Method SaveGraph

tensorflow/core/summary/summary_db_writer.cc:334–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 }
333
334 Status SaveGraph(int64 run_id) {
335 const char* sql = R"sql(
336 INSERT OR REPLACE INTO Graphs (
337 run_id,
338 graph_id,
339 inserted_time,
340 graph_def
341 ) VALUES (?, ?, ?, ?)
342 )sql";
343 SqliteStatement insert;
344 TF_RETURN_IF_ERROR(db_->Prepare(sql, &insert));
345 if (run_id != kAbsent) insert.BindInt(1, run_id);
346 insert.BindInt(2, graph_id_);
347 insert.BindDouble(3, DoubleTime(now_));
348 graph_->clear_node();
349 string graph_def;
350 if (graph_->SerializeToString(&graph_def)) {
351 insert.BindBlobUnsafe(4, graph_def);
352 }
353 return insert.StepAndReset();
354 }
355
356 Status MaybeFlush() {
357 if (unflushed_bytes_ >= kFlushBytes) {

Callers 1

GraphWriterClass · 0.80

Calls 7

DoubleTimeFunction · 0.85
BindIntMethod · 0.80
BindDoubleMethod · 0.80
BindBlobUnsafeMethod · 0.80
StepAndResetMethod · 0.80
PrepareMethod · 0.45
SerializeToStringMethod · 0.45

Tested by

no test coverage detected