-
Notifications
You must be signed in to change notification settings - Fork 14
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 issue #249 #250
Fix issue #249 #250
Conversation
I think the PR looks good and gets rid of the ForwardDiff bug (at least for the 3 argument dot product). However, I am a bit hesitant of renaming all function dot(x::AbstractVector, A::AbstractMatrix, y::AbstractVector{<:DualNumber})
(axes(x)..., axes(y)...) == axes(A) || throw(DimensionMismatch())
T = typeof(dot(first(x), first(A), first(y)))
s = zero(T)
i₁ = first(eachindex(x))
x₁ = first(x)
@inbounds for j in eachindex(y)
yj = y[j]
temp = zero(adjoint(A[i₁,j]) * x₁)
@simd for i in eachindex(x)
temp += adjoint(A[i,j]) * x[i]
end
s += dot(temp, yj)
end
return s
end |
@bartvanerp Agreed, I've changed the PR to use multiple dispatch instead. Let's see if all tests are passing on CI. |
Codecov ReportBase: 61.61% // Head: 61.69% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #250 +/- ##
==========================================
+ Coverage 61.61% 61.69% +0.07%
==========================================
Files 194 195 +1
Lines 7183 7200 +17
==========================================
+ Hits 4426 4442 +16
- Misses 2757 2758 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bvdmitri! Well Done!
This PR fixes #249 . The underlying issue happens to be related to
ForwardDiff.jl
. JuliaDiff/ForwardDiff.jl#622 JuliaDiff/ForwardDiff.jl#481