Skip to content

Commit

Permalink
simplify sum rrule (#239)
Browse files Browse the repository at this point in the history
* simplify sum rrule

* bump version
  • Loading branch information
piever committed Jul 16, 2020
1 parent 9a364d6 commit e9aa66e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "0.7.9"
version = "0.7.10"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/Base/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function frule((_, ẋ), ::typeof(sum), x; dims=:)
end

function rrule(::typeof(sum), x::AbstractArray{T}; dims=:) where {T<:Number}
y = sum(sum, x; dims=dims)
y = sum(x; dims=dims)
function sum_pullback(ȳ)
# broadcasting the two works out the size no-matter `dims`
= broadcast(x, ȳ) do xi, ȳi
Expand Down

2 comments on commit e9aa66e

@willtebbutt
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/18014

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.10 -m "<description of version>" e9aa66e84eee3bfee1a04f83ee950cf6bbfe5a36
git push origin v0.7.10

Please sign in to comment.