Skip to content

Commit

Permalink
Correct rule
Browse files Browse the repository at this point in the history
Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
simsurace and devmotion authored Feb 7, 2024
1 parent 23c531e commit 63cc118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function ChainRulesCore.rrule(s::Sinus, x::AbstractVector, y::AbstractVector)
d = x - y
abs2_sind_r = (sinpi.(d) ./ s.r) .^ 2

Check warning on line 114 in src/chainrules.jl

View check run for this annotation

Codecov / codecov/patch

src/chainrules.jl#L114

Added line #L114 was not covered by tests
val = sum(abs2_sind_r)
gradx = π .* cospi.(2 .* d) ./ s.r .^ 2
gradx = π .* sinpi.(2 .* d) ./ s.r .^ 2

Check warning on line 116 in src/chainrules.jl

View check run for this annotation

Codecov / codecov/patch

src/chainrules.jl#L116

Added line #L116 was not covered by tests
function evaluate_pullback::Any)
= -2Δ .* abs2_sind_r ./ s.r
= ChainRulesCore.Tangent{typeof(s)}(; r=r̄)
Expand Down

0 comments on commit 63cc118

Please sign in to comment.