#define GGML_MAX_DIMS 4
). ne
and nb
of the ggml_tensor
struct) ggml_new_tensor
, ggml_new_tensor_1d
, ggml_new_tensor_2d
, ggml_new_tensor_3d
or ggml_new_tensor_4d
. ggml_op
enum. ggml_time_init | To be called once when the program initializes |
ggml_init | Allocates a memory buffer (for a tensor?) and returns a pointer to a ggml_context . |
ggml_new_tensor_* | Create new tensors whose data is stored in the memory allocated with ggml_init . |
ggml_new_tensor_1d | Returns a pointer to a ggml_tensor |
ggml_set_param | |
ggml_used_mem | Determine amount of memory used in ??? |
ggml_build_forward , ggml_build_forward_expand , ggml_build_backward | |
ggml_free | |
ggml_nelements , ggml_nbytes | |
ggml_graph_compute | Requests to compute 'a function' |
ggml_blck_size , ggml_type_size , ggml_type_sizef | |
ggml_permute | |
ggml_conv_1d_1s | |
ggml_conv_1d_2s | |
ggml_quantize_q4_0 , ggml_quantize_q4_1 | |
ggml_get_f32_1d , ggml_set_f32_1d | |
ggml_time_ms , ggml_time_us | |
ggml_cycles , ggml_cycles_per_ms | |
ggml_print_object , ggml_print_objects | |
ggml_used_mem | |
ggml_add ,ggml_mul , … |
ggml_init_params | |
ggml_context | A pointer to a ggml_context is returned by ggml_init() |
ggml_tensor | A representation about a tensor stored in the momory. The struct has fields to query the tensor's size, data type and memory buffer. src points to the tensors from which the tensor was computed from. A pointer to a ggml_tensor is returned by ggml_new_tensor_1d |
ggml_object | |
ggml_cgraph | Computation graph |
ggml_scratch | Scratch buffer |
src | |
ne | Number of elements in each dimension of the tensor |
nb | Number of bytes (a.k.a. stride) |
data | Pointer to the memory buffer |
{ struct ggml_tensor * c = ggml_add(ctx, a, b); assert(c->src[0] == a); assert(c->src[1] == b); }
ggml_type
, ggml_op
ggml_opt_type
allows for the two optimization methods ggml_linesearch
):