improve performance of sum backward pass
use add1(x,y) instead of add(x,repeat(y,x))
This commit is contained in:
parent
0197bcb0ff
commit
bfe507213c
1 changed files with 2 additions and 2 deletions
4
ggml.c
4
ggml.c
|
@ -12640,9 +12640,9 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
|
|||
{
|
||||
if (src0->grad) {
|
||||
src0->grad =
|
||||
ggml_add_impl(ctx,
|
||||
ggml_add1_impl(ctx,
|
||||
src0->grad,
|
||||
ggml_repeat(ctx, tensor->grad, src0->grad),
|
||||
tensor->grad,
|
||||
inplace);
|
||||
}
|
||||
} break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue