MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / avg

Function avg

examples/llama-bench/llama-bench.cpp:57–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56template<typename T>
57static T avg(const std::vector<T> & v) {
58 if (v.empty()) {
59 return 0;
60 }
61 T sum = std::accumulate(v.begin(), v.end(), T(0));
62 return sum / (T)v.size();
63}
64
65template<typename T>
66static T stdev(const std::vector<T> & v) {

Callers 3

stdevFunction · 0.70
avg_nsMethod · 0.70
avg_tsMethod · 0.70

Calls 5

TFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected