mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-27 03:44:35 +00:00
llama.cpp : use ggml_elements()
This commit is contained in:
parent
5a0a2c5685
commit
d6fd53afd6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user