Skip to content

Commit c66b7d2

Browse files
authored
Update ggml.c
1 parent 3ee194f commit c66b7d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ggml/src/ggml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22956,6 +22956,14 @@ void gguf_add_tensor(
2295622956
ctx->header.n_tensors++;
2295722957
}
2295822958

22959+
void gguf_set_tensor_ndim(struct gguf_context * ctx, const char * name, const int n_dim) {
22960+
const int idx = gguf_find_tensor(ctx, name);
22961+
if (idx < 0) {
22962+
GGML_ABORT("tensor not found");
22963+
}
22964+
ctx->infos[idx].n_dims = n_dim;
22965+
}
22966+
2295922967
void gguf_set_tensor_type(struct gguf_context * ctx, const char * name, enum ggml_type type) {
2296022968
const int idx = gguf_find_tensor(ctx, name);
2296122969
if (idx < 0) {

0 commit comments

Comments
 (0)