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

Function stdev

examples/llama-bench/llama-bench.cpp:66–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65template<typename T>
66static T stdev(const std::vector<T> & v) {
67 if (v.size() <= 1) {
68 return 0;
69 }
70 T mean = avg(v);
71 T sq_sum = std::inner_product(v.begin(), v.end(), v.begin(), T(0));
72 T stdev = std::sqrt(sq_sum / (T)(v.size() - 1) - mean * mean * (T)v.size() / (T)(v.size() - 1));
73 return stdev;
74}
75
76static std::string get_cpu_info() {
77 std::string id;

Callers 2

stdev_nsMethod · 0.70
stdev_tsMethod · 0.70

Calls 6

sqrtFunction · 0.85
avgFunction · 0.70
TFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected