ggml : just in case

This commit is contained in:
Georgi Gerganov 2023-09-04 20:48:25 +03:00
parent ad80e5a4a7
commit 7704db2521
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

2
ggml.c
View File

@ -4285,7 +4285,7 @@ int64_t ggml_nrows(const struct ggml_tensor * tensor) {
}
size_t ggml_nbytes(const struct ggml_tensor * tensor) {
size_t nbytes = tensor->ne[0]*tensor->nb[0]/ggml_blck_size(tensor->type);
size_t nbytes = (tensor->ne[0]*tensor->nb[0])/ggml_blck_size(tensor->type);
for (int i = 1; i < GGML_MAX_DIMS; ++i) {
nbytes += (tensor->ne[i] - 1)*tensor->nb[i];
}