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

added type for differentiate in chain_rules.jl #214

Open
wants to merge 1 commit into
base: bl/chain_rules
Choose a base branch
from
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