aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/stat_summarizer.cc
diff options
context:
space:
mode:
authorGravatar Andrew Harp <andrewharp@google.com>2016-11-11 16:43:51 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-11 17:02:51 -0800
commit1743ad893859ea342c3c6b04a5292b763ae4aead (patch)
treeb02f61f10035aa0004e338084fe2841dcbbc9b18 /tensorflow/core/util/stat_summarizer.cc
parentf27dea2f016baf09040bf5aec705511486a3f205 (diff)
Add python wrapper for StatSummarizer.
Change: 138933733
Diffstat (limited to 'tensorflow/core/util/stat_summarizer.cc')
-rw-r--r--tensorflow/core/util/stat_summarizer.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/tensorflow/core/util/stat_summarizer.cc b/tensorflow/core/util/stat_summarizer.cc
index 33cf5fe961..0b675eaac9 100644
--- a/tensorflow/core/util/stat_summarizer.cc
+++ b/tensorflow/core/util/stat_summarizer.cc
@@ -338,13 +338,19 @@ std::string StatSummarizer::GetStatsByOrderOfNodeDefinitions(
return stream.str();
}
+std::string StatSummarizer::GetOutputString() const {
+ std::stringstream stream;
+ stream << "Total time (us): " << run_total_micros_;
+ stream << GetTimingStatsByRunOrder();
+ stream << GetTimingStatsByTopDurations();
+ stream << "Total Memory (bytes): " << memory_;
+ stream << GetMemoryStatsByRunOrder();
+ stream << GetMemoryStatsByUsage();
+ return stream.str();
+}
+
void StatSummarizer::PrintStepStats() const {
- LOG(INFO) << "Total time (us): " << run_total_micros_;
- LOG(INFO) << GetTimingStatsByRunOrder();
- LOG(INFO) << GetTimingStatsByTopDurations();
- LOG(INFO) << "Total Memory (bytes): " << memory_;
- LOG(INFO) << GetMemoryStatsByRunOrder();
- LOG(INFO) << GetMemoryStatsByUsage();
+ LOG(INFO) << GetOutputString();
LOG(INFO);
}