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

Method AddValue

tensorflow/core/util/util.cc:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void MovingAverage::AddValue(double v) {
70 if (count_ < window_) {
71 // This is the warmup phase. We don't have a full window's worth of data.
72 head_ = count_;
73 data_[count_++] = v;
74 } else {
75 if (window_ == ++head_) {
76 head_ = 0;
77 }
78 // Toss the oldest element
79 sum_ -= data_[head_];
80 // Add the newest element
81 data_[head_] = v;
82 }
83 sum_ += v;
84}
85
86static char hex_char[] = "0123456789abcdef";
87

Callers 1

RunStepMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected