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

Update to ChainRulesCore 0.5.1 #146

Merged
merged 12 commits into from
Jan 12, 2020
Merged

Update to ChainRulesCore 0.5.1 #146

merged 12 commits into from
Jan 12, 2020

Conversation

YingboMa
Copy link
Member

No description provided.

Oops, accidentally removed fdm test
@nickrobinson251
Copy link
Contributor

Maybe point this PR at Lyndon's branch? #145

@YingboMa YingboMa changed the title Update to ChainRule 0.5 Update to ChainRulesCore 0.5 Jan 11, 2020
@YingboMa
Copy link
Member Author

Waiting for JuliaDiff/ChainRulesCore.jl#90

@YingboMa YingboMa changed the title Update to ChainRulesCore 0.5 Update to ChainRulesCore 0.5.1 Jan 12, 2020
Copy link
Member

@oxinabox oxinabox left a 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 Show resolved Hide resolved
end
return BLAS.asum(x), asum_pushforward
function frule(::typeof(BLAS.asum), x, _, Δx)
return BLAS.asum(x), sum(cast(sign, x) * Δx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return BLAS.asum(x), sum(cast(sign, x) * Δx)
return BLAS.asum(x), sum(sign(x) .* Δx)

Copy link
Member Author

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.

Copy link
Member

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,

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back.

src/rulesets/LinearAlgebra/dense.jl Outdated Show resolved Hide resolved
src/rulesets/LinearAlgebra/dense.jl Outdated Show resolved Hide resolved
test/rulesets/Base/base.jl Outdated Show resolved Hide resolved
test/rulesets/Base/base.jl Show resolved Hide resolved
test/rulesets/Base/base.jl Outdated Show resolved Hide resolved
test/test_util.jl Outdated Show resolved Hide resolved
test/test_util.jl Outdated Show resolved Hide resolved
test/test_util.jl Outdated Show resolved Hide resolved
@YingboMa YingboMa merged commit 3d2618e into master Jan 12, 2020
@YingboMa YingboMa deleted the myb/fuse_frule branch January 12, 2020 23:01
@oxinabox oxinabox mentioned this pull request Jan 15, 2020
3 tasks
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.

None yet

3 participants