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

Method UpdateStat

tensorflow/core/util/stats_calculator.h:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34class Stat {
35 public:
36 void UpdateStat(ValueType v) {
37 if (count_ == 0) {
38 first_ = v;
39 }
40
41 newest_ = v;
42 max_ = std::max(v, max_);
43 min_ = std::min(v, min_);
44 ++count_;
45 sum_ += v;
46 squared_sum_ += static_cast<HighPrecisionValueType>(v) * v;
47 }
48
49 void Reset() { new (this) Stat<ValueType, HighPrecisionValueType>(); }
50

Callers 8

TimeMultipleRunsFunction · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
UpdateRunTotalUsMethod · 0.80
UpdateMemoryUsedMethod · 0.80
AddNodeStatsMethod · 0.80

Calls 2

maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected