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

Function ggml_opt_set_params

ggml.c:18200–18209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18198////////////////////////////////////////////////////////////////////////////////
18199
18200static void ggml_opt_set_params(int np, struct ggml_tensor * const ps[], const float * x) {
18201 int i = 0;
18202 for (int p = 0; p < np; ++p) {
18203 const int64_t ne = ggml_nelements(ps[p]) ;
18204 // TODO: add function to set tensor from array
18205 for (int64_t j = 0; j < ne; ++j) {
18206 ggml_set_f32_1d(ps[p], j, x[i++]);
18207 }
18208 }
18209}
18210
18211static void ggml_opt_get_params(int np, struct ggml_tensor * const ps[], float * x) {
18212 int i = 0;

Callers 2

linesearch_backtrackingFunction · 0.85
ggml_opt_lbfgsFunction · 0.85

Calls 2

ggml_nelementsFunction · 0.70
ggml_set_f32_1dFunction · 0.70

Tested by

no test coverage detected