llama : fix uninitialized tensors

This commit is contained in:
Georgi Gerganov 2024-09-26 15:20:11 +03:00
parent 4d457755c0
commit ca99a6ce70
No known key found for this signature in database
GPG Key ID: BF970631944C16B7

View File

@ -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<llama_layer> layers;