Fix reset of unused g->nodes and g->grads to NULL

This commit is contained in:
xaedes 2023-06-17 18:56:27 +02:00
parent d395b19c8c
commit d7003a98cc
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

View file

@ -1403,8 +1403,8 @@ void graph_set_leafs_grads(struct ggml_cgraph * g) {
}
}
for (int i=n_nodes; i < g->n_nodes; ++i) {
g->nodes[n_nodes] = NULL;
g->grads[n_nodes] = NULL;
g->nodes[i] = NULL;
g->grads[i] = NULL;
}
g->n_nodes = n_nodes;
}