Skip to content

Commit

Permalink
Debug what's happening in ChainRulesCoreExt
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Oct 21, 2024
1 parent 453a4dc commit 75fc1b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/QuaternionicChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ isdefined(Base, :get_extension) ?
# It's likely that StaticArrays will have its own ChainRulesCore extension someday, so we
# need to check if there is already a ProjectTo defined for SArray. If so, we'll use that.
# If not, we'll define one here.
@info [repr(method) for method in methods(ProjectTo) if occursin("SArray", repr(method.sig))]
@show any(method->occursin("SArray", repr(method.sig)), methods(ProjectTo))

Check warning on line 16 in ext/QuaternionicChainRulesCoreExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/QuaternionicChainRulesCoreExt.jl#L16

Added line #L16 was not covered by tests
if !any(method->occursin("SArray", repr(method.sig)), methods(ProjectTo))
@info "Defining ProjectTo for SArray"
# These are ripped from https://github.com/JuliaArrays/StaticArrays.jl/pull/1068
function (project::ProjectTo{<:Tangent{<:Tuple}})(dx::SArray)
dy = reshape(dx, axes(project.elements)) # allows for dx::OffsetArray
Expand Down

0 comments on commit 75fc1b5

Please sign in to comment.