From e3149a216869c969b92f14615174fc182646704f Mon Sep 17 00:00:00 2001 From: Ed Addario <29247825+EAddario@users.noreply.github.com> Date: Sun, 17 Aug 2025 07:24:27 +0100 Subject: [PATCH] Use the corresponding size Co-authored-by: compilade --- tools/imatrix/imatrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/imatrix/imatrix.cpp b/tools/imatrix/imatrix.cpp index e1c962f5be..ce4dc23e85 100644 --- a/tools/imatrix/imatrix.cpp +++ b/tools/imatrix/imatrix.cpp @@ -761,7 +761,7 @@ void IMatrixCollector::save_imatrix(int32_t n_chunk) const { const int32_t nact = (int32_t) stat.activations.size(); struct ggml_tensor * in_sum = ggml_new_tensor_2d(ctx, GGML_TYPE_F32, nact / nmat, nmat); ggml_format_name(in_sum, "%s.in_sum", name.c_str()); - for (int32_t j = 0; j < nval; ++j) { + for (int32_t j = 0; j < nact; ++j) { ((float *) in_sum->data)[j] = (float) stat.activations[j]; } gguf_add_tensor(ctx_gguf, in_sum);