From f067d52bea6f18acc11aa8c038b5b28cef47a5f9 Mon Sep 17 00:00:00 2001 From: mike dupont Date: Sat, 25 Nov 2023 09:09:00 -0500 Subject: [PATCH] Naming the unnamed ggml structures Here we add names for the nested structures of ggml --- ggml.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ggml.h b/ggml.h index d9bd9bd24..1d69be2b0 100644 --- a/ggml.h +++ b/ggml.h @@ -1861,7 +1861,7 @@ extern "C" { int n_gradient_accumulation; // ADAM parameters - struct { + struct ggml_adam{ int n_iter; float sched; // schedule multiplier (fixed, decay or warmup) @@ -1877,7 +1877,7 @@ extern "C" { } adam; // LBFGS parameters - struct { + struct ggml_lbfgs{ int m; // number of corrections to approximate the inv. Hessian int n_iter; int max_linesearch; @@ -1904,7 +1904,7 @@ extern "C" { float loss_before; float loss_after; - struct { + struct ggml_grad{ struct ggml_tensor * g; // current gradient struct ggml_tensor * m; // first moment struct ggml_tensor * v; // second moment @@ -1914,7 +1914,7 @@ extern "C" { int n_no_improvement; } adam; - struct { + struct ggml_params{ struct ggml_tensor * x; // current parameters struct ggml_tensor * xp; // previous parameters struct ggml_tensor * g; // current gradient @@ -2144,7 +2144,7 @@ extern "C" { typedef void (*ggml_from_float_t)(const float * GGML_RESTRICT x, void * GGML_RESTRICT y, int k); typedef void (*ggml_vec_dot_t) (const int n, float * GGML_RESTRICT s, const void * GGML_RESTRICT x, const void * GGML_RESTRICT y); - typedef struct { + typedef struct ggml_something{ const char * type_name; int blck_size; size_t type_size;