Skip to content

Commit

Permalink
Fix conj in sdiag_pow rrule
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrehmer committed Dec 11, 2024
1 parent 20a68f9 commit 76889d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utility/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ function ChainRulesCore.rrule(
)
tol *= norm(S, Inf)
spow = sdiag_pow(S, pow; tol)
spow_minus1 = sdiag_pow(S, pow - 1; tol)
spow_minus1_conj = sdiag_pow(S', pow - 1; tol)
function sdiag_pow_pullback(c̄)
return (ChainRulesCore.NoTangent(), pow * _elementwise_mult(c̄, spow_minus1'))
return (ChainRulesCore.NoTangent(), pow * _elementwise_mult(c̄, spow_minus1_conj))

Check warning on line 65 in src/utility/util.jl

View check run for this annotation

Codecov / codecov/patch

src/utility/util.jl#L62-L65

Added lines #L62 - L65 were not covered by tests
end
return spow, sdiag_pow_pullback

Check warning on line 67 in src/utility/util.jl

View check run for this annotation

Codecov / codecov/patch

src/utility/util.jl#L67

Added line #L67 was not covered by tests
end
Expand Down

0 comments on commit 76889d3

Please sign in to comment.