MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_get_next_tensor

Function ggml_get_next_tensor

subprojects/llama.cpp/ggml/src/ggml.c:1889–1904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1887}
1888
1889struct ggml_tensor * ggml_get_next_tensor(const struct ggml_context * ctx, struct ggml_tensor * tensor) {
1890 struct ggml_object * obj = (struct ggml_object *) ((char *)tensor - GGML_OBJECT_SIZE);
1891 obj = obj->next;
1892
1893 char * const mem_buffer = ctx->mem_buffer;
1894
1895 while (obj != NULL) {
1896 if (obj->type == GGML_OBJECT_TYPE_TENSOR) {
1897 return (struct ggml_tensor *)(mem_buffer + obj->offs);
1898 }
1899
1900 obj = obj->next;
1901 }
1902
1903 return NULL;
1904}
1905
1906struct ggml_tensor * ggml_get_tensor(struct ggml_context * ctx, const char * name) {
1907 struct ggml_object * obj = ctx->objects_begin;

Callers 15

file_inputMethod · 0.85
load_imatrixFunction · 0.85
load_imatrixMethod · 0.85
load_tensorsMethod · 0.85
llama_kv_cacheMethod · 0.85
llama_model_loaderMethod · 0.85
get_mapping_rangeMethod · 0.85
load_all_dataMethod · 0.85
assign_namesFunction · 0.85
check_max_sizeFunction · 0.85
initialize_tensorsMethod · 0.85

Calls

no outgoing calls

Tested by 15

assign_namesFunction · 0.68
check_max_sizeFunction · 0.68
initialize_tensorsMethod · 0.68
evalMethod · 0.68
eval_gradMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68
initialize_tensorsMethod · 0.68