Fix ggml_nbytes (#1798)

This commit is contained in:
Kawrakow 2026-05-13 17:39:25 +03:00 committed by GitHub
parent 397150caa2
commit 6b221f0c1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4738,7 +4738,7 @@ GGML_CALL size_t ggml_nbytes(const struct ggml_tensor * tensor) {
}
}
else {
nbytes = tensor->nb[1]; //tensor->ne[0]*tensor->nb[0]/blck_size;
nbytes = ggml_row_size(tensor->type, tensor->ne[0]);
for (int i = 1; i < GGML_MAX_DIMS; ++i) {
nbytes += (tensor->ne[i] - 1)*tensor->nb[i];
}