terminate recursive tensor cloning when reaching tensor without src tensors
This commit is contained in:
parent
0dd496c5e2
commit
52c92c0a8c
1 changed files with 11 additions and 0 deletions
|
@ -1423,6 +1423,17 @@ struct ggml_tensor * ggml_recompute_graph_node(
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int count_children = 0;
|
||||||
|
for (int k = 0; k < GGML_MAX_SRC; ++k) {
|
||||||
|
if (node->src[k]) {
|
||||||
|
++count_children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count_children == 0) {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
size_t i = hash_find(replacements->keys, node);
|
size_t i = hash_find(replacements->keys, node);
|
||||||
GGML_ASSERT(i < GGML_GRAPH_HASHTABLE_SIZE); // assert that not full
|
GGML_ASSERT(i < GGML_GRAPH_HASHTABLE_SIZE); // assert that not full
|
||||||
if (replacements->keys[i] == node) {
|
if (replacements->keys[i] == node) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue