simplify backward pass for SQRT
This commit is contained in:
parent
6d40cc3a44
commit
c47df09842
1 changed files with 4 additions and 4 deletions
8
ggml.c
8
ggml.c
|
@ -13063,11 +13063,11 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
|
||||||
src0->grad =
|
src0->grad =
|
||||||
ggml_add_impl(ctx,
|
ggml_add_impl(ctx,
|
||||||
src0->grad,
|
src0->grad,
|
||||||
ggml_mul(ctx,
|
ggml_scale(ctx,
|
||||||
tensor->grad, // this was not catched by test_grad because in test_grad tensor->grad is 1
|
|
||||||
ggml_div(ctx,
|
ggml_div(ctx,
|
||||||
ggml_repeat(ctx, ggml_new_f32(ctx, 0.5f), tensor),
|
tensor->grad,
|
||||||
tensor)),
|
tensor),
|
||||||
|
ggml_new_f32(ctx, 0.5f)),
|
||||||
inplace);
|
inplace);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue