-
Notifications
You must be signed in to change notification settings - Fork 89
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
rrule
for Base.sum
should accept init
keyword
#656
Comments
cc @mcabbott |
There's a rule for sum, ChainRules.jl/src/rulesets/Base/mapreduce.jl Lines 28 to 41 in 9adf759
init keyword, added in Julia 1.6:
julia> sum([1 2 3; 4 5 6]; init=10)
31
julia> sum([1 2 3; 4 5 6]; init=10, dims=1)
1×3 Matrix{Int64}:
15 17 19 also:
|
mcabbott
changed the title
Need
Aug 3, 2022
rrule
for Base.sum
rrule
for Base.sum
should accept init
keyword
Xref JuliaDiff/ChainRulesCore.jl#384 --- the lowered form is this
but defining a rule as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The below issue contains an MWE of Zygote erroring on the
init
kwarg toBase.sum
. Best way to fix it would be to define anrrule
forsum
FluxML/Zygote.jl#1279
The text was updated successfully, but these errors were encountered: