Open vpuri3 opened 2 years ago
the case with sum works when I remove the kwarg init
. but still curious why it wouldn't work otherwise
foldl
not tracking init
keyword is https://github.com/JuliaDiff/ChainRules.jl/issues/567, you could try with https://github.com/JuliaDiff/ChainRules.jl/pull/569
sum
not supporting init
is also bad, could you make an issue on ChainRules.jl?
julia> ChainRules.rrule(sum, [1,2,3]; init=4)
ERROR: MethodError: no method matching rrule(::typeof(sum), ::Vector{Int64}; init::Int64)
Closest candidates are:
rrule(::typeof(sum), ::AbstractArray; dims) got unsupported keyword argument "init"
@ ChainRules ~/.julia/packages/ChainRules/BbzFc/src/rulesets/Base/mapreduce.jl:28
rrule(::typeof(sum), ::Any, ::AbstractArray{Bool}; sum_pullback) got unsupported keyword argument "init"
@ ChainRules ~/.julia/packages/ChainRules/BbzFc/src/rulesets/Base/nondiff.jl:82
MWE
ref - https://github.com/SciML/SciMLOperators.jl/pull/94