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
We used to have a nice error message for differentiating through try/catch block, saying "Can't differentiate function execution in catch block". On julia v1.11, we have a cryptic "unreachable" error instead:
julia>functiontry_catch_finally(cond, x)
try
x =2x
cond &&throw(DomainError())
catch
x =2x
finally
x =3x
end
x
end
julia> res, pull =pullback(try_catch_finally, true, 1.)
(12.0, Zygote.var"#78#79"{Zygote.Pullback{Tuple{typeof(try_catch_finally), Bool, Float64}, Any}}(∂(try_catch_finally)))
julia>pull(1)
ERROR: unreachable
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] try_catch_finally
@ ./REPL[12]:8 [inlined]
[3] (::Zygote.Pullback{Tuple{typeof(try_catch_finally), Bool, Float64}, Any})(Δ::Int64)
@ Zygote ~/.julia/dev/Zygote/src/compiler/interface2.jl:0
[4] (::Zygote.var"#78#79"{Zygote.Pullback{Tuple{typeof(try_catch_finally), Bool, Float64}, Any}})(Δ::Int64)
@ Zygote ~/.julia/dev/Zygote/src/compiler/interface.jl:91
[5] top-level scope
@ REPL[16]:1
The text was updated successfully, but these errors were encountered:
I think it's because try-catch is supported in a limited fashion after #1474, but this hits an edge case that didn't cover. @Pangoraw have you seen this before?
We used to have a nice error message for differentiating through try/catch block, saying "Can't differentiate function execution in catch block". On julia v1.11, we have a cryptic "unreachable" error instead:
The text was updated successfully, but these errors were encountered: