Naming the unnamed ggml structures

Here we add names for the nested structures of ggml
This commit is contained in:
mike dupont 2023-11-25 09:09:00 -05:00
parent 3faef69427
commit f067d52bea

10
ggml.h
View file

@ -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;