diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-06-06 13:50:41 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-06-06 15:03:32 -0700 |
commit | ca2a66bda4d46689f8a031414de052a600b9882f (patch) | |
tree | 781cf28ed844de961e9ee26fa22fe1d43ae654ab /tensorflow/core/util/stat_summarizer.h | |
parent | 35e23065d860f82020149544912314f152e42267 (diff) |
Correct a bug in calculating the standard deviation in StatSummarizer used in benchmark code.
Change: 124180552
Diffstat (limited to 'tensorflow/core/util/stat_summarizer.h')
-rw-r--r-- | tensorflow/core/util/stat_summarizer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/core/util/stat_summarizer.h b/tensorflow/core/util/stat_summarizer.h index 9a82bdc3e1..c5dea66c65 100644 --- a/tensorflow/core/util/stat_summarizer.h +++ b/tensorflow/core/util/stat_summarizer.h @@ -69,9 +69,9 @@ class Stat { : static_cast<HighPrecisionValueType>(sum_) / count_; } - ValueType rms() const { return sqrt(squared_sum_ / count_); } - - ValueType std_deviation() const { return all_same() ? 0 : rms() - avg(); } + ValueType std_deviation() const { + return all_same() ? 0 : sqrt(squared_sum_ / count_ - avg() * avg()); + } void OutputToStream(std::ostream* stream) const { if (empty()) { |