From ca99a6ce70bf4fcb50a70b7efa9d6dbd1a93f22e Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 26 Sep 2024 15:20:11 +0300 Subject: [PATCH] llama : fix uninitialized tensors --- src/llama.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index c85e3033c..179c0f977 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -2875,6 +2875,7 @@ struct llama_model { llama_hparams hparams = {}; llama_vocab vocab; + // TODO: should init all tensors to nullptr struct ggml_tensor * tok_embd; struct ggml_tensor * type_embd; struct ggml_tensor * pos_embd; @@ -2890,8 +2891,8 @@ struct llama_model { // classifier struct ggml_tensor * cls; struct ggml_tensor * cls_b; - struct ggml_tensor * cls_out; - struct ggml_tensor * cls_out_b; + struct ggml_tensor * cls_out = nullptr; + struct ggml_tensor * cls_out_b = nullptr; std::vector layers;