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

Function gguf_set_arr_data

ggml.c:20078–20086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20076}
20077
20078void gguf_set_arr_data(struct gguf_context * ctx, const char * key, enum gguf_type type, const void * data, int n) {
20079 const int idx = gguf_get_or_add_key(ctx, key);
20080
20081 ctx->kv[idx].type = GGUF_TYPE_ARRAY;
20082 ctx->kv[idx].value.arr.type = type;
20083 ctx->kv[idx].value.arr.n = n;
20084 ctx->kv[idx].value.arr.data = malloc(n*GGUF_TYPE_SIZE[type]);
20085 memcpy(ctx->kv[idx].value.arr.data, data, n*GGUF_TYPE_SIZE[type]);
20086}
20087
20088void gguf_set_arr_str(struct gguf_context * ctx, const char * key, const char ** data, int n) {
20089 const int idx = gguf_get_or_add_key(ctx, key);

Callers 4

gguf_set_kvFunction · 0.70
save_llama_model_ggufFunction · 0.50
save_as_llama_modelFunction · 0.50
gguf_ex_writeFunction · 0.50

Calls 1

gguf_get_or_add_keyFunction · 0.85

Tested by

no test coverage detected