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:
@@ -1186,6 +1186,11 @@ const char * gguf_get_tensor_name(const struct gguf_context * ctx, int64_t tenso
|
||||
return ctx->info[tensor_id].t.name;
|
||||
}
|
||||
|
||||
const int64_t * gguf_get_tensor_ne(const struct gguf_context * ctx, int64_t tensor_id) {
|
||||
GGML_ASSERT(tensor_id >= 0 && tensor_id < gguf_get_n_tensors(ctx));
|
||||
return ctx->info[tensor_id].t.ne;
|
||||
}
|
||||
|
||||
enum ggml_type gguf_get_tensor_type(const struct gguf_context * ctx, int64_t tensor_id) {
|
||||
GGML_ASSERT(tensor_id >= 0 && tensor_id < gguf_get_n_tensors(ctx));
|
||||
return ctx->info[tensor_id].t.type;
|
||||
|
||||
Reference in New Issue
Block a user