mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-07-23 11:10:55 -05:00
gguf : add tensor shape accessor (#24405)
* gguf : add tensor shape accessors * gguf : return tensor shape as const int64_t * * gguf : remove n_dims accessor, keep only gguf_get_tensor_ne
This commit is contained in:
@@ -662,6 +662,13 @@ static bool handcrafted_check_tensors(const gguf_context * gguf_ctx, const unsig
|
||||
if (gguf_get_tensor_type(gguf_ctx, id) != type) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
const int64_t * ne = gguf_get_tensor_ne(gguf_ctx, id);
|
||||
for (int j = 0; j < GGML_MAX_DIMS; ++j) {
|
||||
if (ne[j] != shape[j]) {
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ok = false;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user