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

Function ggml_get_first_tensor

ggml.c:3059–3073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3057}
3058
3059struct ggml_tensor * ggml_get_first_tensor(struct ggml_context * ctx) {
3060 struct ggml_object * obj = ctx->objects_begin;
3061
3062 char * const mem_buffer = ctx->mem_buffer;
3063
3064 while (obj != NULL) {
3065 if (obj->type == GGML_OBJECT_TENSOR) {
3066 return (struct ggml_tensor *)(mem_buffer + obj->offs);
3067 }
3068
3069 obj = obj->next;
3070 }
3071
3072 return NULL;
3073}
3074
3075struct ggml_tensor * ggml_get_next_tensor(struct ggml_context * ctx, struct ggml_tensor * tensor) {
3076 struct ggml_object * obj = (struct ggml_object *) ((char *)tensor - GGML_OBJECT_SIZE);

Callers 2

init_modelFunction · 0.50
init_loraFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected