From 0dd496c5e21a6baeb377babd769efa8e01981e9e Mon Sep 17 00:00:00 2001 From: xaedes Date: Mon, 14 Aug 2023 17:52:48 +0200 Subject: [PATCH] fix variable name and add missing type cast --- examples/train-text-from-scratch/train-text-from-scratch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index 92e6315dc..266f378b9 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -1425,8 +1425,8 @@ struct ggml_tensor * ggml_recompute_graph_node( size_t i = hash_find(replacements->keys, node); GGML_ASSERT(i < GGML_GRAPH_HASHTABLE_SIZE); // assert that not full - if (replacements->keys[i] == p) { - return replacements->vals[i]; + if (replacements->keys[i] == node) { + return (struct ggml_tensor *) replacements->vals[i]; } struct ggml_tensor * clone = ggml_new_tensor(ctx, node->type, node->n_dims, node->ne);