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

Function ggml_opt_get_params

ggml.c:18211–18220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18209}
18210
18211static void ggml_opt_get_params(int np, struct ggml_tensor * const ps[], float * x) {
18212 int i = 0;
18213 for (int p = 0; p < np; ++p) {
18214 const int64_t ne = ggml_nelements(ps[p]) ;
18215 // TODO: add function to get all elements at once
18216 for (int64_t j = 0; j < ne; ++j) {
18217 x[i++] = ggml_get_f32_1d(ps[p], j);
18218 }
18219 }
18220}
18221
18222static void ggml_opt_get_grad(int np, struct ggml_tensor * const ps[], float * g) {
18223 int64_t i = 0;

Callers 1

ggml_opt_lbfgsFunction · 0.85

Calls 2

ggml_nelementsFunction · 0.70
ggml_get_f32_1dFunction · 0.70

Tested by

no test coverage detected