ggml : fix nullptr derefs in GGML_OP_CONT and GGML_OP_RESHAPE back

This commit is contained in:
Georgi Gerganov 2023-05-08 18:50:04 +03:00
parent 78af3e92c9
commit 6cc42deda5
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

6
ggml.c
View file

@ -13891,9 +13891,6 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
GGML_ASSERT(ggml_is_contiguous(tensor->grad));
src0->grad = ggml_add_impl(ctx, src0->grad, tensor->grad, inplace);
}
if (src1->grad) {
// noop
}
} break;
case GGML_OP_RESHAPE:
{
@ -13904,9 +13901,6 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
ggml_reshape(ctx, tensor->grad, src0->grad),
inplace);
}
if (src1->grad) {
// noop
}
} break;
case GGML_OP_VIEW:
{