-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
e.g. example by @SomTambe
julia> f(x) = 8x + 10*sin(x)
f (generic function with 1 method)
julia> function ChainRulesCore.rrule(::typeof(f), x)
y = f(x)
function ∇f(Δ)
∇ = 8 + 10*cos(x)
@show ∇ Δ
return ChainRulesCore.NoTangent(), Δ * ∇
end
return y, ∇f
end
julia> test_rrule(f, 2);
∇ = 3.838531634528576
Δ = 2.31
∇ = 3.838531634528576
Δ = 2.31
test_rrule: f on Int64: Test Failed at /home/somvt/.julia/packages/ChainRulesTestUtils/AX7fv/src/testers.jl:278
Expression: ad_cotangent isa NoTangent
Evaluated: 8.86700807576101 isa NoTangent
...
Test Summary: | Pass Fail Total
test_rrule: f on Int64 | 4 1 5
ERROR: Some tests did not pass: 4 passed, 1 failed, 0 errored, 0 broken.the error message is confusing, we could special case it for actual::AbstractFloat, expected::NoTangent as suggested by @oxinabox
willtebbuttSomTambe
Metadata
Metadata
Assignees
Labels
No labels