bug fix for scale backward pass
use sum instead of mean for gradient of scalar scale parameter
This commit is contained in:
parent
671e5922e2
commit
a367eb9eda
1 changed files with 1 additions and 1 deletions
2
ggml.c
2
ggml.c
|
@ -12802,7 +12802,7 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
|
||||||
src1->grad =
|
src1->grad =
|
||||||
ggml_add_impl(ctx,
|
ggml_add_impl(ctx,
|
||||||
src1->grad,
|
src1->grad,
|
||||||
ggml_mean(ctx, ggml_mul_impl(ctx, tensor->grad, src0, false)),
|
ggml_sum(ctx, ggml_mul_impl(ctx, tensor->grad, src0, false)),
|
||||||
inplace);
|
inplace);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue