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:
parent
a6aafdd719
commit
f4e9ce7998
1 changed files with 2 additions and 2 deletions
4
ggml.c
4
ggml.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue