ggml: Add backward computation for unary op `exp
`
Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
This commit is contained in:
parent
c6955525b4
commit
8aa711ad98
1 changed files with 9 additions and 0 deletions
|
@ -18843,6 +18843,15 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor
|
|||
zero_table);
|
||||
}
|
||||
} break;
|
||||
case GGML_UNARY_OP_EXP:
|
||||
{
|
||||
if (src0->grad) {
|
||||
src0->grad = ggml_add_or_set(ctx,
|
||||
src0->grad,
|
||||
ggml_mul(ctx, tensor, tensor->grad),
|
||||
zero_table);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
GGML_ABORT("fatal error");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue