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

Function ggml_vec_argmax_f32

ggml.c:1572–1580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1570}
1571
1572inline static void ggml_vec_argmax_f32(const int n, int * s, const float * x) {
1573 float max = -INFINITY;
1574 int idx = 0;
1575 for (int i = 0; i < n; ++i) {
1576 max = MAX(max, x[i]);
1577 if (max == x[i]) { idx = i; }
1578 }
1579 *s = idx;
1580}
1581
1582//
1583// data types

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected