enable gradient propagation for inplace add1 and scale operations

those functions backward passes don't need the original src0, so they also work when forward is inplace
This commit is contained in:
xaedes 2023-05-20 14:49:19 +02:00
parent a6aafdd719
commit f4e9ce7998
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

4
ggml.c
View file

@ -4374,7 +4374,7 @@ struct ggml_tensor * ggml_add1_impl(
bool is_node = false;
if (!inplace && (a->grad || b->grad)) {
if (a->grad || b->grad) {
is_node = true;
}
@ -5205,7 +5205,7 @@ struct ggml_tensor * ggml_scale_impl(
bool is_node = false;
if (!inplace && (a->grad || b->grad)) {
if (a->grad || b->grad) {
is_node = true;
}