Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/chain_rules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ end
function ChainRulesCore.frule((_, Δp, _), ::typeof(differentiate), p, x)
return differentiate(p, x), differentiate(Δp, x)
end
function pullback(Δdpdx, x)
function pullback_differentiate_polynomial(Δdpdx, x)
return ChainRulesCore.NoTangent(), x * differentiate(x * Δdpdx, x), ChainRulesCore.NoTangent()
end
function ChainRulesCore.rrule(::typeof(differentiate), p, x)
function ChainRulesCore.rrule(::typeof(differentiate), p::APL, x)
Copy link
Member

Choose a reason for hiding this comment

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

Is that resolving an issue you had ? differentiate is defined by this package so I don't think it would give issue to not specify the type here

dpdx = differentiate(p, x)
return dpdx, Base.Fix2(pullback, x)
return dpdx, Base.Fix2(pullback_differentiate_polynomial, x)
end