-
Notifications
You must be signed in to change notification settings - Fork 85
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
Update to ChainRulesCore 0.5.1 #146
Conversation
Oops, accidentally removed fdm test
602537b
to
d393d12
Compare
Maybe point this PR at Lyndon's branch? #145 |
Waiting for JuliaDiff/ChainRulesCore.jl#90 |
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.
If it passes CI, and you fix up the things I mention in comments,
then looks good to me.
Thanks for this;
src/rulesets/LinearAlgebra/blas.jl
Outdated
end | ||
return BLAS.asum(x), asum_pushforward | ||
function frule(::typeof(BLAS.asum), x, _, Δx) | ||
return BLAS.asum(x), sum(cast(sign, x) * Δx) |
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.
return BLAS.asum(x), sum(cast(sign, x) * Δx) | |
return BLAS.asum(x), sum(sign(x) .* Δx) |
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.
There is actually no BLAS.asum(x)
, so I removed it.
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.
Fair enough, wonder how it got in there,
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.
Ah, I confused myself. BLAS.asum(x)
is there, but it is not documented in Julia
help?> BLAS.asum
asum(n, X, incx)
Sum of the absolute values of the first n elements of array X with stride incx.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> BLAS.asum(5, fill(1.0im, 10), 2)
5.0
julia> BLAS.asum(2, fill(1.0im, 10), 5)
2.0
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.
Added back.
This reverts commit 3fe59b4.
No description provided.