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

Function ggml_graph_get_grad

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

Source from the content-addressed store, hash-verified

7185}
7186
7187struct ggml_tensor * ggml_graph_get_grad(const struct ggml_cgraph * cgraph, const struct ggml_tensor * node) {
7188 const size_t igrad = ggml_hash_find(&cgraph->visited_hash_set, node);
7189 return igrad != GGML_HASHSET_FULL && ggml_bitset_get(cgraph->visited_hash_set.used, igrad) && cgraph->grads ? cgraph->grads[igrad] : NULL;
7190}
7191
7192struct ggml_tensor * ggml_graph_get_grad_acc(const struct ggml_cgraph * cgraph, const struct ggml_tensor * node) {
7193 const size_t igrad = ggml_hash_find(&cgraph->visited_hash_set, node);

Callers 6

eval_gradMethod · 0.85
ggml_compute_backwardFunction · 0.85
ggml_graph_printFunction · 0.85
ggml_graph_get_parentFunction · 0.85
ggml_graph_dump_dotFunction · 0.85
ggml_opt_buildFunction · 0.85

Calls 2

ggml_hash_findFunction · 0.85
ggml_bitset_getFunction · 0.85

Tested by 1

eval_gradMethod · 0.68