| 18198 | //////////////////////////////////////////////////////////////////////////////// |
| 18199 | |
| 18200 | static 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 | |
| 18211 | static void ggml_opt_get_params(int np, struct ggml_tensor * const ps[], float * x) { |
| 18212 | int i = 0; |
no test coverage detected