llama.cpp : use ggml_elements()

This commit is contained in:
klosax 2023-08-17 15:24:35 +02:00 committed by GitHub
parent 5a0a2c5685
commit d6fd53afd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1051,11 +1051,7 @@ struct llama_model_loader {
for (int i = 0; i < n_tensors; i++) { for (int i = 0; i < n_tensors; i++) {
const char * name = gguf_get_tensor_name(ctx_gguf, i); const char * name = gguf_get_tensor_name(ctx_gguf, i);
struct ggml_tensor * t = ggml_get_tensor(ctx_meta, name); struct ggml_tensor * t = ggml_get_tensor(ctx_meta, name);
size_t elem = 1; n_tot_elements += ggml_nelements(t);
for (int j = 0; j < t->n_dims; j++) {
elem *= t->ne[j];
}
n_tot_elements += elem;
} }
// print meta data // print meta data