You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using ChainRulesCore
myplus(x,y) = x + y
function ChainRulesCore.rrule(::typeof(myplus), x, y)
println("myplus rrule forward")
x+y, dz -> begin
println("myplus rrule reverse, dz isa ", typeof(dz))
NoTangent(), @thunk(unthunk(dz)), @thunk @show unthunk(dz)
end
end
using Yota
grad([1,2,3]) do x
prod(myplus(x, [4,5,6]))
end
Activity
vectrrule pullbacks index a thunked cotangent once per argument (quadratic), same pattern as #860 #862 as a duplicate of this issue