Output correct error message in ggml_new_tensor_impl when out of scratch space.
This commit is contained in:
parent
89951748db
commit
ab4f1fa8e2
1 changed files with 1 additions and 1 deletions
2
ggml.c
2
ggml.c
|
@ -4683,7 +4683,7 @@ struct ggml_tensor * ggml_new_tensor_impl(
|
|||
size_t size_needed = 0;
|
||||
|
||||
if (!ggml_tensor_required_memory(ctx, type, n_dims, ne, data, &ctx_needed, &scratch_needed)) {
|
||||
if (scratch_needed > 0 && ctx->scratch.size) {
|
||||
if (scratch_needed > 0 && ctx->scratch.offs + scratch_needed > ctx->scratch.size) {
|
||||
GGML_PRINT("%s: not enough space in the scratch memory (needed %zu, available %zu)\n",
|
||||
__func__, ctx->scratch.offs + scratch_needed, ctx->scratch.size);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue