Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _densification_pullback bug #111

Merged
merged 3 commits into from
Jul 25, 2022
Merged

Fix _densification_pullback bug #111

merged 3 commits into from
Jul 25, 2022

Conversation

mzgubic
Copy link
Collaborator

@mzgubic mzgubic commented Jul 25, 2022

Found in JuliaGaussianProcesses/LinearMixingModels.jl#51

Previously we had

julia> test_rrule(Matrix, D, output_tangent=UpperTriangular(rand(4, 4)))
test_rrule: Matrix on BlockDiagonal{Float64, Matrix{Float64}}: Error During Test at /Users/mzgubic/.julia/environments/v1.7/dev/ChainRulesTestUtils/src/testers.jl:193
  Got exception outside of a @test
  MethodError: no method matching _densification_pullback(::UpperTriangular{Float64, Matrix{Float64}}, ::Type{BlockDiagonal{Float64, Matrix{Float64}}}, ::Vector{Int64}, ::Vector{Int64})
  Closest candidates are:
    _densification_pullback(::ChainRulesCore.AbstractThunk, ::Any, ::Any, ::Any) at ~/JuliaEnvs/LinearMixingModels.jl/dev/BlockDiagonals/src/chainrules.jl:39
    _densification_pullback(::Matrix, ::Any, ::Any, ::Any) at ~/JuliaEnvs/LinearMixingModels.jl/dev/BlockDiagonals/src/chainrules.jl:28

This fixes the bug

@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #111 (e7f8c20) into master (7bac0da) will decrease coverage by 0.18%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   96.17%   95.98%   -0.19%     
==========================================
  Files           5        5              
  Lines         340      324      -16     
==========================================
- Hits          327      311      -16     
  Misses         13       13              
Impacted Files Coverage Δ
src/chainrules.jl 100.00% <100.00%> (ø)
src/blockdiagonal.jl 86.76% <0.00%> (-0.56%) ⬇️
src/linalg.jl 95.34% <0.00%> (-0.21%) ⬇️
src/base_maths.jl 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

@mzgubic mzgubic merged commit 6223d3f into master Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants