diff options
author | Andrew Harp <andrewharp@google.com> | 2016-12-28 19:38:03 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-12-28 19:52:20 -0800 |
commit | a1a3b0c6c3abe0df0c8e017d9f134db4731484b9 (patch) | |
tree | 45321c54ed6ecc03fae8b1a764eb4913d813fd70 /tensorflow/core/util/stat_summarizer.h | |
parent | a081f4b06f89273c67c832a94314b124ed7fdda0 (diff) |
Android: show inference stats on debug screen in demo (accessed with volume keys).
Change: 143149923
Diffstat (limited to 'tensorflow/core/util/stat_summarizer.h')
-rw-r--r-- | tensorflow/core/util/stat_summarizer.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tensorflow/core/util/stat_summarizer.h b/tensorflow/core/util/stat_summarizer.h index f766f0f281..7159cce88d 100644 --- a/tensorflow/core/util/stat_summarizer.h +++ b/tensorflow/core/util/stat_summarizer.h @@ -113,6 +113,15 @@ class Stat { // See tensorflow/examples/android/jni/tensorflow_jni.cc for an example usage. class StatSummarizer { public: + enum SortingMetric { + BY_NAME, + BY_DEFINITION_ORDER, + BY_RUN_ORDER, + BY_TIME, + BY_MEMORY, + BY_TYPE, + }; + explicit StatSummarizer(const tensorflow::GraphDef& tensorflow_graph); // Adds another run's StepStats output to the aggregate counts. @@ -122,6 +131,8 @@ class StatSummarizer { // format which can be pasted into a spreadsheet for further analysis. std::string GetOutputString() const; + std::string ShortSummary() const; + // Prints the string returned by GetOutputString(). void PrintStepStats() const; @@ -130,6 +141,10 @@ class StatSummarizer { std::string GetStatsByNodeType() const; + std::string GetStatsByMetric(const string& title, + SortingMetric sorting_metric, + int num_stats) const; + void Reset() { run_total_us_.Reset(); memory_.Reset(); @@ -153,31 +168,16 @@ class StatSummarizer { std::vector<TensorDescription> outputs; }; - enum SortingMetric { - BY_NAME, - BY_DEFINITION_ORDER, - BY_RUN_ORDER, - BY_TIME, - BY_MEMORY, - BY_TYPE, - }; - void Validate(const Detail* detail, const NodeExecStats& ns) const; void OrderNodesByMetric(SortingMetric sorting_metric, std::vector<const Detail*>* details) const; - std::string GetStatsByMetric(const string& title, - SortingMetric sorting_metric, - int num_stats) const; - std::string HeaderString(const string& title) const; std::string ColumnString(const Detail& detail, const int64 cumulative_stat_on_node, const Stat<int64>& stat) const; - std::string ShortSummary() const; - Stat<int64> run_total_us_; Stat<int64> memory_; |