diff --git a/ggml.c b/ggml.c index eb469d0f7953d..81100e27766b7 100644 --- a/ggml.c +++ b/ggml.c @@ -2938,7 +2938,7 @@ static struct ggml_tensor * ggml_new_tensor_impl( data_size *= ne[i]; } - GGML_ASSERT(view_src == NULL || data_size + view_offs <= ggml_nbytes(view_src)); + GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src)); void * data = view_src != NULL ? view_src->data : NULL; if (data != NULL) {