Open
Description
Quite a few packages define a function to tell whether they are inside AD, as of https://github.com/FluxML/Flux.jl/pull/1863/files#r806287154 Flux has:
istraining() = false
# @adjoint istraining() = true, _ -> nothing
ChainRulesCore.rrule(::typeof(istraining)) = true, _ -> (NoTangent(),)
Maybe CRC should provide one?
It could be true/false. It could also be Val(true)
, or it could something more elaborate like:
order() = (fwd=0, rev=0, total=0)
What thoughts?