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

Function ggml_graph_reset

ggml.c:16444–16454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16442}
16443
16444void ggml_graph_reset(struct ggml_cgraph * cgraph) {
16445 GGML_ASSERT(cgraph->grads != NULL);
16446
16447 for (int i = 0; i < cgraph->n_nodes; i++) {
16448 struct ggml_tensor * grad = cgraph->grads[i];
16449
16450 if (grad) {
16451 ggml_set_zero(grad);
16452 }
16453 }
16454}
16455
16456void ggml_graph_clear(struct ggml_cgraph * cgraph) {
16457 cgraph->n_leafs = 0;

Callers 2

check_gradientFunction · 0.50
mainFunction · 0.50

Calls 1

ggml_set_zeroFunction · 0.70

Tested by 2

check_gradientFunction · 0.40
mainFunction · 0.40