ggml : add assert upon adding nodes
Some checks failed
flake8 Lint / Lint (push) Has been cancelled

This commit is contained in:
Georgi Gerganov 2024-09-12 09:31:39 +03:00
parent ee154457dd
commit b8c9b8e468
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -19202,6 +19202,7 @@ int ggml_graph_n_nodes(struct ggml_cgraph * cgraph) {
}
void ggml_graph_add_node(struct ggml_cgraph * cgraph, struct ggml_tensor * tensor) {
GGML_ASSERT(cgraph->size > cgraph->n_nodes);
cgraph->nodes[cgraph->n_nodes] = tensor;
cgraph->n_nodes++;
}