aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/reporter.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-04-22 06:25:17 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-04-22 07:31:52 -0700
commit9668b2981c32ebd804feed9970d7e95c8573e644 (patch)
tree7f5349d66de85015a29d6b33fe09250c5ff8efb4 /tensorflow/core/util/reporter.cc
parente9db74626ea9e46a93eb0c15c37a2e138c83fade (diff)
Change tensorflow benchmark code to export results as serialized proto instead
of text proto. This simplifies ues of LITE_RUNTIME for mobile, where text functions are not available natively. Change: 120545368
Diffstat (limited to 'tensorflow/core/util/reporter.cc')
-rw-r--r--tensorflow/core/util/reporter.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/tensorflow/core/util/reporter.cc b/tensorflow/core/util/reporter.cc
index 1fe25afa66..ec5a5b6af7 100644
--- a/tensorflow/core/util/reporter.cc
+++ b/tensorflow/core/util/reporter.cc
@@ -27,15 +27,11 @@ TestReporter::TestReporter(const string& fname, const string& test_name)
Status TestReporter::Close() {
if (closed_) return Status::OK();
- string entry_string;
- if (!protobuf::TextFormat::PrintToString(benchmark_entry_, &entry_string)) {
- return errors::Internal("Could not serialize to string: ",
- benchmark_entry_.DebugString());
- }
+ BenchmarkEntries entries;
+ *entries.add_entry() = benchmark_entry_;
+ TF_RETURN_IF_ERROR(log_file_->Append(entries.SerializeAsString()));
- TF_RETURN_IF_ERROR(log_file_->Append(entry_string));
benchmark_entry_.Clear();
-
closed_ = true;
return log_file_->Close();